1 | #################################################################### |
---|
2 | ### |
---|
3 | ### Makefile for Singular documentation |
---|
4 | ##################################################################### |
---|
5 | SHELL=/bin/sh |
---|
6 | |
---|
7 | #################################################################### |
---|
8 | ## |
---|
9 | ## Configuration |
---|
10 | ## |
---|
11 | SINGUNAME = spielwiese |
---|
12 | |
---|
13 | bindir = @bindir@ |
---|
14 | |
---|
15 | ## |
---|
16 | ## needed programs |
---|
17 | ## |
---|
18 | MKINSTALLDIRS = mkdir -p |
---|
19 | UUDECODE = uudecode |
---|
20 | |
---|
21 | PERL = perl |
---|
22 | TEX = tex |
---|
23 | MAKEINFO = makeinfo --force |
---|
24 | TEXI2PDF = @TEXI2PDF@ |
---|
25 | TEXINDEX = @TEXINDEX@ |
---|
26 | # use our local texi2html |
---|
27 | TEXI2HTML = ./texi2html |
---|
28 | DVIPS = dvips |
---|
29 | |
---|
30 | VERBOSE = 1 # override this with make VERBOSE=2 |
---|
31 | |
---|
32 | # d2t stuff |
---|
33 | SINGULAR = /scratch/hannes/billbo-sw/Singular/Singular |
---|
34 | SINGULAR_LIB_DIR= ../Singular/LIB |
---|
35 | ifeq ($(SINGUNAME),"ix86-Win") |
---|
36 | LIBPARSE = ${bindir}/libparse.exe |
---|
37 | else |
---|
38 | LIBPARSE = ./libparse |
---|
39 | endif |
---|
40 | DOC_SUBDIR = ./d2t_singular |
---|
41 | EX_SUBDIR = ./examples |
---|
42 | CHKSUM_DB = ${DOC_SUBDIR}/chksum |
---|
43 | # which tags to avoid: |
---|
44 | DOC2TEX_EXAMPLE_EXCLUSIONS = -exclude polymake |
---|
45 | # which tags to avoid: |
---|
46 | TAG = polymake |
---|
47 | DOC2TEX = ${PERL} ./doc2tex.pl -docdir ${DOC_SUBDIR} \ |
---|
48 | -Singular ${SINGULAR} -verbose ${VERBOSE} -make ${MAKE} \ |
---|
49 | -exdir ${EX_SUBDIR} ${DOC2TEX_EXAMPLE_EXCLUSIONS} |
---|
50 | |
---|
51 | DOC2TEX_M = ${PERL} ./doc2tex.pl -docdir ${DOC_SUBDIR} \ |
---|
52 | -Singular ${SINGULAR} -verbose ${VERBOSE} -make ${MAKE} \ |
---|
53 | -exdir ${EX_SUBDIR} |
---|
54 | |
---|
55 | PL2DOC = ${PERL} ./pl2doc.pl ${TAG} -db ${CHKSUM_DB} |
---|
56 | PL2DOC_M = ${PERL} ./pl2doc.pl -db ${CHKSUM_DB} |
---|
57 | |
---|
58 | # t2h stuff |
---|
59 | TMP_DIR = tmp |
---|
60 | HTML_SUBDIR = html |
---|
61 | TEXI2HTML_INIT = t2h_singular.init |
---|
62 | ifeq ($(VERBOSE),0) |
---|
63 | T2H_VERBOSE = |
---|
64 | else |
---|
65 | T2H_VERBOSE = -Verbose |
---|
66 | endif |
---|
67 | TEXI2HTML_OPTS = -init_file ${TEXI2HTML_INIT} -l2h \ |
---|
68 | -short_ext -l2h_tmp ${TMP_DIR} -subdir ${HTML_SUBDIR} \ |
---|
69 | ${T2H_VERBOSE} |
---|
70 | HTML_MANUAL_PREFIX = sing |
---|
71 | HTML_TUTOR_PREFIX = tut |
---|
72 | HTML_MANUAL_TOP = index.htm |
---|
73 | HTML_TUTOR_TOP = tutor.htm |
---|
74 | ## |
---|
75 | ## End configuration dependend stuff |
---|
76 | ################################################################# |
---|
77 | |
---|
78 | ########################################################### |
---|
79 | # File sets |
---|
80 | # |
---|
81 | STANDALONE_TEXI_FILES = COPYING.texi INSTALL_unix.texi NEWS.texi \ |
---|
82 | README_download.texi README_ftp.texi \ |
---|
83 | README_distribution.texi README_src.texi \ |
---|
84 | INSTALL_win.texi |
---|
85 | |
---|
86 | DOC2TEX_FILES = cones.tex countedref.tex decodegb.tex \ |
---|
87 | examples.tex general.tex ti_ip.tex math.tex reference.tex \ |
---|
88 | start.tex types.tex pdata.tex tricks.tex platform.tex \ |
---|
89 | plural.tex letterplace.tex plulibs.tex sca.tex pyobject.tex |
---|
90 | |
---|
91 | MANUAL_FILES = ${TEX_FILES} ${DOC2TEX_FILES} |
---|
92 | |
---|
93 | TUTOR_FILES = \ |
---|
94 | tutor.tex examples.tex start.tex COPYING.texi |
---|
95 | |
---|
96 | IMAGES_UU := $(wildcard images/*.uu) |
---|
97 | IMAGES := $(IMAGES_UU:images/%.uu=%) |
---|
98 | IMAGES_SRC := $(IMAGES:%=images/%) |
---|
99 | IMAGES_HTML := $(IMAGES:%=${HTML_SUBDIR}/%) |
---|
100 | |
---|
101 | # prepend bindir to path so that programs from there are taken first |
---|
102 | export PATH := "${bindir}:${PATH}" |
---|
103 | |
---|
104 | ########################################################### |
---|
105 | # top targets |
---|
106 | # |
---|
107 | |
---|
108 | .PHONY: info dvi ps html |
---|
109 | |
---|
110 | # default target |
---|
111 | all: info dvi html singular.idx |
---|
112 | |
---|
113 | # info stuff |
---|
114 | info: singular.hlp |
---|
115 | |
---|
116 | singular.hlp: ${MANUAL_FILES} singular.tex s-plural.tex s-plulibs.tex s-letterplace.tex |
---|
117 | - ${MAKEINFO} --no-split singular.tex |
---|
118 | |
---|
119 | # dvi stuff |
---|
120 | dvi: manual.dvi usercard.dvi |
---|
121 | |
---|
122 | singular.dvi: ${MANUAL_FILES} singular.tex s-plural.tex s-plulibs.tex s-letterplace.tex |
---|
123 | tex singular.tex |
---|
124 | texindex singular.cp |
---|
125 | tex singular.tex |
---|
126 | texindex singular.cp |
---|
127 | tex singular.tex |
---|
128 | |
---|
129 | singular.pdf: ${MANUAL_FILES} singular.tex s-plural.tex s-plulibs.tex s-letterplace.tex |
---|
130 | ${TEXI2PDF} singular.tex |
---|
131 | |
---|
132 | manual.dvi: ${MANUAL_FILES} manual.tex s-plural.tex s-plulibs.tex s-letterplace.tex |
---|
133 | tex manual.tex |
---|
134 | texindex manual.cp |
---|
135 | tex manual.tex |
---|
136 | texindex manual.cp |
---|
137 | tex manual.tex |
---|
138 | |
---|
139 | tutor.dvi: ${TUTOR_FILES} |
---|
140 | tex tutor.tex |
---|
141 | tex tutor.tex |
---|
142 | tex tutor.tex |
---|
143 | |
---|
144 | tutor.pdf: ${TUTOR_FILES} |
---|
145 | ${TEXI2PDF} tutor.tex |
---|
146 | |
---|
147 | usercard.dvi: usercard.tex singcard.tex |
---|
148 | ${TEX} $< |
---|
149 | |
---|
150 | s-plural.tex: plural.tex |
---|
151 | sed -e "s/BR_PLURAL_BR/(plural)/g" <plural.tex >s-plural.tex |
---|
152 | |
---|
153 | s-plulibs.tex: plulibs.tex |
---|
154 | sed -e "s/BR_PLURAL_BR/(plural)/g" <plulibs.tex >s-plulibs.tex |
---|
155 | |
---|
156 | s-letterplace.tex: letterplace.tex |
---|
157 | sed -e "s/BR_LETTERPLACE_BR/(letterplace)/g" <letterplace.tex >s-letterplace.tex |
---|
158 | |
---|
159 | # postscript stuff |
---|
160 | ps: dvi manual.ps usercard.ps |
---|
161 | |
---|
162 | usercard.ps: usercard.dvi |
---|
163 | ${DVIPS} -t landscape -t a4 $< -o $@ |
---|
164 | |
---|
165 | %.ps: %.dvi |
---|
166 | ${DVIPS} $< -o $@ |
---|
167 | |
---|
168 | ########################################################### |
---|
169 | # texinfo targets |
---|
170 | # |
---|
171 | manual.tex: ${MANUAL_FILES} doc2tex.pl ${SINGULAR} singular.doc $(STANDALONE_TEXI_FILES) |
---|
172 | +${DOC2TEX_M} -no_fun -o manual.tex singular.doc |
---|
173 | |
---|
174 | singular.tex: ${MANUAL_FILES} doc2tex.pl ${LIB_TEX_FILES} ${SINGULAR} ${LIBPARSE} singular.doc $(STANDALONE_TEXI_FILES) |
---|
175 | +${DOC2TEX} -o singular.tex singular.doc |
---|
176 | |
---|
177 | #pattern rule for tex files |
---|
178 | %_noEx.tex : %.doc doc2tex.pl ${SINGULAR} |
---|
179 | +${DOC2TEX_M} -o $@ -no_ex $< |
---|
180 | |
---|
181 | %.tex: %.doc doc2tex.pl ${SINGULAR} |
---|
182 | +${DOC2TEX} -o $@ $< |
---|
183 | |
---|
184 | # pattern rules for lib docus |
---|
185 | ${DOC_SUBDIR}/%_lib.pl : ${SINGULAR_LIB_DIR}/%.lib ${LIBPARSE} |
---|
186 | test -d ${DOC_SUBDIR} || mkdir ${DOC_SUBDIR} |
---|
187 | ${LIBPARSE} -i $< > $@ |
---|
188 | |
---|
189 | %_noFun.doc : %.pl pl2doc.pl |
---|
190 | ${PL2DOC_M} -no_fun -o $@ $< |
---|
191 | |
---|
192 | %.doc : %.pl pl2doc.pl |
---|
193 | ${PL2DOC} -o $@ $< |
---|
194 | |
---|
195 | # do not delete intermediate .pl and .doc files |
---|
196 | .PRECIOUS: %.doc %_noFun.doc ${DOC_SUBDIR}/%_lib.pl |
---|
197 | |
---|
198 | # index file for help |
---|
199 | singular.idx: singular.hlp ${HTML_SUBDIR}/${HTML_MANUAL_PREFIX}_cp.idx doc2idx.pl |
---|
200 | ${PERL} doc2idx.pl singular.hlp ${HTML_SUBDIR}/${HTML_MANUAL_PREFIX}_cp.idx ${CHKSUM_DB} > singular.idx |
---|
201 | |
---|
202 | ########################################################### |
---|
203 | |
---|
204 | ifeq ($(SINGUNAME),@SINGUNAME@) |
---|
205 | UNAME_OPT = -D UNAME |
---|
206 | endif |
---|
207 | |
---|
208 | # targets which produce stand-alone documents |
---|
209 | %.${SINGUNAME}.txt : %.texi |
---|
210 | ${MAKEINFO} $(UNAME_OPT) --no-header --paragraph-indent none -o $@ $< |
---|
211 | |
---|
212 | %.txt : %.texi |
---|
213 | ${MAKEINFO} --no-header --paragraph-indent none -o $@ $< |
---|
214 | |
---|
215 | %.${SINGUNAME}.html : %.texi |
---|
216 | ${PERL} ${TEXI2HTML} $(UNAME_OPT) -init_file t2h_standalone.init -split none -out_file $@ $< |
---|
217 | |
---|
218 | %.html : %.texi |
---|
219 | ${PERL} ${TEXI2HTML} -init_file t2h_standalone.init -split none -out_file $@ $< |
---|
220 | |
---|
221 | % : %.txt |
---|
222 | cp $< $@ |
---|
223 | |
---|
224 | ########################################################### |
---|
225 | # html targets |
---|
226 | # |
---|
227 | html: ${TMP_DIR} ${HTML_SUBDIR}/${HTML_MANUAL_TOP} ${IMAGES_HTML} $(STANDALONE_TEXI_FILES) |
---|
228 | ${HTML_SUBDIR}/${HTML_MANUAL_TOP}: ${TEXI2HTML_INIT} ${TEXI2HTML} singular.tex s-plural.tex s-letterplace.tex |
---|
229 | ${PERL} ${TEXI2HTML} ${TEXI2HTML_OPTS} -prefix ${HTML_MANUAL_PREFIX} \ |
---|
230 | -top_file ${HTML_MANUAL_TOP} singular.tex |
---|
231 | |
---|
232 | # html stuff |
---|
233 | html_tutor: ${TMP_DIR} ${HTML_SUBDIR}/${HTML_TUTOR_TOP} ${IMAGES_HTML} |
---|
234 | ${HTML_SUBDIR}/${HTML_TUTOR_TOP}: ${TEXI2HTML_INIT} ${TEXI2HTML} tutor.tex |
---|
235 | ${PERL} ${TEXI2HTML} ${TEXI2HTML_OPTS} -prefix ${HTML_TUTOR_PREFIX} \ |
---|
236 | -top_file ${HTML_TUTOR_TOP} tutor.tex |
---|
237 | |
---|
238 | ${HTML_SUBDIR}/${HTML_MANUAL_PREFIX}_cp.idx: ${HTML_SUBDIR}/${HTML_MANUAL_TOP} |
---|
239 | |
---|
240 | ${TMP_DIR}: |
---|
241 | ${MKINSTALLDIRS} ${TMP_DIR} |
---|
242 | |
---|
243 | # pattern rules for images - but not everybody has gnu-uudecode |
---|
244 | images/%.gif : images/%.gif.uu |
---|
245 | cd images; ${UUDECODE} ../$< ;cd .. |
---|
246 | |
---|
247 | images/%.jpg : images/%.jpg.uu |
---|
248 | cd images; ${UUDECODE} ../$< ;cd .. |
---|
249 | |
---|
250 | images/%.xbm : images/%.xbm.uu |
---|
251 | cd images; ${UUDECODE} ../$< ;cd .. |
---|
252 | |
---|
253 | ${IMAGES_HTML} : ${IMAGES_SRC} |
---|
254 | test -d ${HTML_SUBDIR} || mkdir ${HTML_SUBDIR} |
---|
255 | cp ${IMAGES_SRC} ${HTML_SUBDIR} |
---|
256 | |
---|
257 | ########################################################### |
---|
258 | # misc targets |
---|
259 | # |
---|
260 | texi2html = $(TEXI2HTML:%.pl=%) |
---|
261 | |
---|
262 | clean: mostlyclean |
---|
263 | /bin/rm -rf singular.tex manual.tex ${DOC_SUBDIR} ${EX_SUBDIR} |
---|
264 | |
---|
265 | mostlyclean: |
---|
266 | /bin/rm -f .singular_hist doe.tmp dump.ascii example.mp example.txt |
---|
267 | /bin/rm -f save_i test.ascii test.mp |
---|
268 | /bin/rm -f Z* *.tst *.pag *.dir *.lst *.log *.aux *.cp *.cps |
---|
269 | /bin/rm -f *.fn *.fns *.ky *.kys *.log *.pg *.pgs *.toc *.tp |
---|
270 | /bin/rm -f *.tps *.vr *.vrs *.dvi *.ps |
---|
271 | /bin/rm -f s-plural.tex s-plulibs.tex s-letterplace.tex |
---|
272 | /bin/rm -f singular.hlp manual.hlp ${DOC2TEX_FILES} singular.idx |
---|
273 | /bin/rm -f manual.hlp |
---|
274 | /bin/rm -f ${HTML_SUBDIR}/${HTML_MANUAL_TOP} ${HTML_SUBDIR}/${HTML_TUTOR_TOP} |
---|
275 | /bin/rm -rf ${STANDALONE_HTML_FILES} ${STANDALONE_FILES} ${STANDALONE_TXT_FILES} |
---|
276 | /bin/rm -f INSTALL_unix.${SINGUNAME}.txt INSTALL_unix.${SINGUNAME}.html |
---|
277 | |
---|
278 | distclean: clean |
---|
279 | /bin/rm -f Makefile |
---|
280 | /bin/rm -rf ${HTML_SUBDIR} ../html ../examples |
---|
281 | |
---|
282 | maintainer-clean: distclean |
---|
283 | |
---|
284 | depend: |
---|
285 | @echo "No make depend available!" |
---|
286 | |
---|
287 | ${SINGULAR}: |
---|
288 | # cd ..; ${MAKE} ${SINGULAR} |
---|
289 | |
---|
290 | html-done: ${MANUAL_FILES} |
---|