# Makefile of DeuTex/DeuSF # by Per Allansson, Olivier Montanuy and André Majorel # # Platform-specific notes: # # Unix User targets should work on all Unices. Some _developer_ # targets, however, require lynx, GCC or GNU tar and gzip. # # DOS "make [all]" should work with DJGPP and Cygwin. With other # compilers, use the batch files in dos\ instead. # "make install" will most likely not work ; install the # executables by hand. # # Others Don't know. Send feedback to the maintainer. # PREFIX=/usr/local # Compiled by users CFLAGS = -O2 CC = cc LDFLAGS = # Compiled by developers DCFLAGS = -g -Wall -Wpointer-arith -Wstrict-prototypes DCC = gcc DLDFLAGS = -g #-lefence #DEFINES = -DDT_ALPHA -DDT_PRIVATE ######### do not edit after this line ######### VERSION = $$(cat VERSION) DISTARC = deutex-$(VERSION).tar.gz DISTARCDOS = deutex-$(VERSION).zip DISTARCDOS8 = dtex$$(tr -cd '[0-9]' $@ strip: deutex deusf strip deutex strip deusf doc: $(DDOCUNIX) unixtmp1: mkdir -p $@ unixtmp1/CHANGES: docsrc/changes.htm* VERSION echo 'THIS IS A GENERATED FILE -- DO NOT EDIT !' >$@ echo 'Edit docsrc/changes.html instead.' >>$@ lynx -dump $< >>$@ unixtmp1/COPYING: docsrc/COPYING cp -p $< $@ unixtmp1/COPYING.LIB: docsrc/COPYING.LIB cp -p $< $@ unixtmp1/INSTALL: docsrc/INSTALL VERSION scripts/process scripts/process $< >$@ unixtmp1/LICENSE: docsrc/LICENSE VERSION scripts/process scripts/process $< >$@ unixtmp1/README: docsrc/README VERSION scripts/process scripts/process $< >$@ unixtmp1/TODO: docsrc/todo.htm* VERSION echo 'THIS IS A GENERATED FILE -- DO NOT EDIT !' >$@ echo 'Edit docsrc/todo.html instead.' >>$@ lynx -dump $< >>$@ unixtmp1/deutex.6: docsrc/deutex.6 VERSION scripts/process scripts/process $< >$@ unixtmp1/dtexman6.txt: docsrc/dtexman6.txt cp -p $< $@ dostmp1: mkdir -p $@ dostmp1/changes.txt: unixtmp1/CHANGES todos <$< >$@ touch -r $< $@ dostmp1/copying: unixtmp1/COPYING todos <$< >$@; touch -r $< $@ dostmp1/copying.lib: unixtmp1/COPYING.LIB todos <$< >$@ touch -r $< $@ dostmp1/dtexman6.txt: unixtmp1/dtexman6.txt todos <$< >$@ touch -r $< $@ dostmp1/license: unixtmp1/LICENSE todos <$< >$@ touch -r $< $@ dostmp1/manpage.txt: unixtmp1/deutex.6 nroff -man -Tlatin1 $< | ul -t dumb | todos >$@ touch -r $< $@ dostmp1/readme.txt: docsrc/readme.dos VERSION scripts/process scripts/process $< | todos >$@ dostmp1/todo.txt: unixtmp1/TODO todos <$< >$@ touch -r $< $@ clean: rm -f $(OBJTEX) $(OBJSF) $(DOBJTEX) $(DOBJSF) deutex deusf if [ -f deutex.exe ]; then rm deutex.exe; fi if [ -f deusf.exe ]; then rm deusf.exe; fi # dist - make the distribution archive for Unix (.tar.gz) dist: $(DISTFILES) $(DDOCUNIX) mkdir -p $(DISTDIR) cp -dpP $(DISTFILES) $(DISTDIR) cp -p $(DDOCUNIXFILES) $(DISTDIR) tar -zcf $(DISTARC) $(DISTDIR) rm -rf $(DISTDIR) # distdos - make the distribution archive DOS (.zip, 8+3) distdos: $(DISTFILES) $(DDOCDOS) mkdir -p $(DISTDIRDOS) cp -dpP $(DISTFILES) $(DISTDIRDOS) cp -p $(DDOCDOSFILES) $(DISTDIRDOS) if [ -e $(DISTARCDOS) ]; then rm $(DISTARCDOS); fi zip -D -X -9 -r $(DISTARCDOS) $(DISTDIRDOS) rm -rf $(DISTDIRDOS) printf 'DeuTex %s\nhttp://www.teaser.fr/~amajorel/deutex/'\ "$(VERSION)" | zip -z $(DISTARCDOS) # distbindos - make the DOS binary distribution archive (.zip, 8+3) TMP=tmpd distbindos: $(DISTFILESBIN) $(DDOCDOS) mkdir -p $(TMP) cp -dpP $(DISTFILESBIN) $(TMP) cp -p $(DDOCDOSFILES) $(TMP) if [ -e $(BINZIP) ]; then rm $(BINZIP); fi export name=$$(pwd)/$(BINZIP); cd $(TMP); zip -D -X -9 -R $$name '*' rm -rf $(TMP) printf 'DeuTex %s\nhttp://www.teaser.fr/~amajorel/deutex/'\ "$(VERSION)" | zip -z $(BINZIP) # save - your daily backup save: tar -zcvf ../deutex-$$(date '+%Y%m%d').tar.gz\ --exclude dostmp1 --exclude unixtmp1\ --exclude "*~" --exclude "*.o"\ --exclude "*.os" --exclude "*.ot"\ --exclude "*.osd" --exclude "*.otd"\ --exclude "*.obj" . # help - display list of interesting targets help: @echo "Targets for end users:" @echo " [all] Build DeuTex and DeuSF" @echo " install Install DeuTex, DeuSF and the doc" @echo @echo "Targets for developers:" @echo " doc Just the doc" @echo " dall Alias for ddeutex + ddeusf" @echo " ddt Alias for ddeutex" @echo " dds Alias for ddeusf" @echo " ddeutex Debug version of DeuTex -> ./deutex" @echo " ddeusf Debug version of DeuSF -> ./deusf" @echo " dist Source dist. (Unix) -> ./deutex-VERSION.tar.gz" @echo " distdos Source dist. (DOS) -> ./dtexVERSION.zip" @echo " distbindos Binary-only dist. (DOS) -> ./deutex-VERSION.bin.dos.zip" @echo " save Backup archive -> ../deutex-YYYYMMDD.tar.gz" @echo " strip Strip ./deutex and ./deusf" @echo " test Run all tests (long)" @echo " clean Remove executables and object files"