1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
|
MINGW=mingw
GCC=gcc -std=gnu17
TARS= tars/tthgoldC.tgz tars/tthgoldL.tar.gz tars/ttmC.tar.gz\
tars/ttmL.tar.gz tars/tthgoldW.exe tars/ttmW.exe
WARN=-Wall -Wno-unused-but-set-variable -Wno-stringop-truncation -Wno-stringop-overflow -Wno-format-overflow
##CFLAGS += -O0
dh_auto_build_default: tth ttm dh_auto_build_tthsplit dh_auto_build_tthrfcat dh_auto_build_manual dh_auto_build_gold_manual
dh_auto_build_tthsplit:
make -C tools tthsplit
dh_auto_build_tthrfcat: tthgold/tthrfcat.c
$(GCC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -Wall -o tthrfcat $<
dh_auto_build_manual: tth dh_auto_build_tthsplit
make -C manual
dh_auto_build_gold_manual: tthgold_manual.tex tth
latex -no-shell-escape -interaction=batchmode $<
./tth -a $<
tthgold_manual.tex: tthgold/gold_man.tex
sed \
-e 's#usr\/local\/tth#usr\/share\/tth#g' \
-e 's#tth\/swedish.bab#tth\/babel\/swedish.bab#g' \
< $< > $@
unopt : tth.c
$(GCC) -o tth $(WARN) tth.c
sleep 1s
date > unopt
# The full tth.lex and ttm.lex are constructed from 3 files.
tth.lex : tthg.lex mathstringsh.lex equationh.lex makefile
sed -e "/mathstringshl/ r mathstringsh.lex" -e "/equationhl/r equationh.lex" tthg.lex >tth.lex
ttm.lex : tthg.lex mathstringsm.lex equationm.lex makefile
sed -e "/mathstringshl/ r mathstringsm.lex"\
-e "/equationhl/r equationm.lex"\
-e "s/static void delimit();//"\
-e "s/static int b_align();//"\
-e "s/[.]html/.xml/"\
-e "/-f? limit/d"\
-e "/-i use/d"\
-e "/-t display/d"\
-e "/-y? equa/d"\
-e "/-w? HTML/,/-w2 XHTML/d"\
-e "/oa_removes/c\\" -e ""\
-e "/start b_align/,/end b_align/c\\" -e ""\
-e "/start symext/,/end symext/c\\" -e ""\
-e "/start delimit/,/end delimit/c\\" -e "" tthg.lex >ttm.lex
ttm.c : ttm.lex
flex -ottm.c ttm.lex
ttm : ttm.c
$(GCC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -Wall -o ttm ttm.c
tth.c : tth.lex
flex -otth.c tth.lex
tth : tth.c
$(GCC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -Wall -o tth tth.c
# The tars are individual packages. Win32, Linux, C.
tars: manual $(TARS)
tars/tthgoldW.exe : tth.exe gui
zip -r tars/tthgoldW tthgold/*.* tthgold/babel -x */*.c
cat SFXWiz32-gcc.exe tars/tthgoldW.zip >tars/tthgoldW.exe
zip -A tars/tthgoldW.exe
tars/tthgoldL.tar.gz : tthstatic
tar czvhf tars/tthgoldL.tar.gz tthgold/tth tthgold/tthprep\
tthgold/tthprep.sty tthgold/gold_man.tex tthgold/gold_man.html\
tthgold/tth_man.tex tthgold/tth_man.html tthgold/README.txt tthgold/tthsplit\
tthgold/amslatex.sty tthgold/babel/* tthgold/latex2gif\
tthgold/tth.gif tthgold/tth.1 tthgold/tthrfcat\
tthgold/tthntbib.sty tthgold/tthxspac.sty tthgold/license.txt
tars/tthgoldC.tgz : tth.c
tar czvhf tars/tthgoldC.tgz tthgold/tth.c tthgold/tthprep\
tthgold/tthprep.bat tthgold/tthprep.sty tthgold/gold_man.tex\
tthgold/gold_man.html tthgold/tth_man.tex tthgold/tth_man.html\
tthgold/README.txt tthgold/tthsplit.c tthgold/amslatex.sty\
tthgold/babel/* tthgold/latex2gif\
tthgold/tth.gif tthgold/tth.1 tthgold/tthrfcat.c\
tthgold/tthntbib.sty tthgold/tthxspac.sty tthgold/license.txt
tth.exe : tth.c tth.res
@echo Using $(MINGW) to create tth.exe
$(MINGW) -o tth.exe tth.res tth.c
tthgold/tth.exe : tth.c
@echo Using $(MINGW) to create tth.exe
$(MINGW) -o tth.exe tth.res tth.c
tars/ttmW.exe : TtMdir/readme.ttm ttm.exe manual/ttm_manual.html
rm -f tars/ttmW.zip
zip -r tars/ttmW.zip TtMdir/*.*
cat SFXWiz32-gcc.exe tars/ttmW.zip >tars/ttmW.exe
zip -A tars/ttmW.exe
tars/ttmC.tar.gz : ttmC/* manual/ttm_manual.html ttm.c
tar czvhf tars/ttmC.tar.gz ttmC/*
tars/ttmL.tar.gz : ttmstatic ttmL/* ttm manual/ttm_manual.html
tar czvhf tars/ttmL.tar.gz ttmL/*
ttmL/ttm_manual.html : manual/ttm_manual.html
ttmstatic : ttm.c
$(GCC) -static -o ttmstatic ttm.c
tthstatic : tth.c
$(GCC) -static -o tthstatic tth.c
ttm.exe : ttm ttm.c ttm.res makefile
$(MINGW) -o ttm.exe ttm.res ttm.c
manual : split tth manual/ttm_manual.html
make -C manual
manual/ttm_manual.html : split tth manual/tth_manual.tex
make -C manual ttm_manual.html
gui :
make -C tth-gui
split :
make -C tools
transfer : tth.lex tth.exe CHANGES
date >transfer
scp CHANGES hutch@silas:~/tth/CHANGES
scp tth.lex hutch@silas:~/tth/tth.lex
scp tth.exe hutch@silas:~/tth/tth.exe
scp manual/tth_manual.tex hutch@silas:~/tth/
ssh silas /home/hutch/bin/maketth
ttmtransfer : ttm.exe ttmstatic tars/ttmW.exe tars/ttmL.tar.gz tars/ttmC.tar.gz
scp tars/ttmW.exe hutch@silas:~/tth/TtM/ttmW.exe
scp tars/ttmL.tar.gz hutch@silas:~/tth/TtM/ttmL.tar.gz
scp tars/ttmC.tar.gz hutch@silas:~/tth/TtM/ttmC.tar.gz
scp ttmstatic hutch@silas:~/tth/TtM/ttm
clean :
rm -f ttmstatic
rm -f tthstatic
rm -f ttm.c
rm -f tth.c
rm -f opt unopt
rm -f tars/*.gz tars/*.zip tars/*.tgz tars/*.exe
rm -f tth tth tth.exe ttm ttm.exe
rm -f tth.lex ttm.lex
make -C manual clean
# make -C tth-gui clean
make -C tools clean
# make -C tthfunc clean
version : tthg.lex
sed -n -e "/define TTH_VERSION/p" tthg.lex | sed -e 's/#define TTH_VERSION "//' -e 's/"//' > version
tarball : clean version
@cd ..; tar --exclude-vcs --exclude=*.tar.gz -czf tth/tth`cat tth/version`.tar.gz tth; echo Made distribution tar ball.
gpg --armor --output tth`cat version`.tar.gz.asc --detach-sig tth`cat version`.tar.gz
|