1 | #################################################################### |
---|
2 | ### |
---|
3 | ### Makefile for Singular documentation |
---|
4 | ##################################################################### |
---|
5 | SHELL=/bin/sh |
---|
6 | |
---|
7 | #################################################################### |
---|
8 | ## |
---|
9 | ## Configuration |
---|
10 | ## |
---|
11 | SINGUNAME = spielwiese |
---|
12 | S_VERSION = 4-0-0 |
---|
13 | |
---|
14 | PYOBECT_TEX = |
---|
15 | #PYOBECT_TEX = pyobject.tex |
---|
16 | |
---|
17 | |
---|
18 | ## directory where info files are installed |
---|
19 | prefix = /tmp/wawa |
---|
20 | infodir = ${prefix}/info |
---|
21 | bindir = @bindir@ |
---|
22 | htmldir = ${prefix}/html |
---|
23 | exdir = ${prefix}/examples |
---|
24 | |
---|
25 | localdir = /usr/local |
---|
26 | install_prefix = ${localdir}/Singular/${S_VERSION} |
---|
27 | install_infodir = ${install_prefix}/info |
---|
28 | install_htmldir = ${install_prefix}/html |
---|
29 | install_docdir = ${install_prefix}/doc |
---|
30 | install_exdir = ${install_prefix}/examples |
---|
31 | |
---|
32 | # directory where files for ftp site go |
---|
33 | ftpdir = /tmp |
---|
34 | |
---|
35 | ## |
---|
36 | ## needed programs |
---|
37 | ## |
---|
38 | LN_S = @LN_S@ |
---|
39 | INSTALL = ../install-sh -c |
---|
40 | INSTALL_PROGRAM = ${INSTALL} |
---|
41 | INSTALL_DATA = ${INSTALL} -m 644 |
---|
42 | MKINSTALLDIRS = mkdir -p |
---|
43 | GZIP = gzip |
---|
44 | UUDECODE = uudecode |
---|
45 | |
---|
46 | PERL = perl |
---|
47 | TEX = tex |
---|
48 | MAKEINFO = makeinfo --force |
---|
49 | TEXI2PDF = @TEXI2PDF@ |
---|
50 | TEXINDEX = @TEXINDEX@ |
---|
51 | # use our local texi2html |
---|
52 | TEXI2HTML = ./texi2html |
---|
53 | DVIPS = dvips |
---|
54 | |
---|
55 | VERBOSE = 1 # override this with make VERBOSE=2 |
---|
56 | |
---|
57 | # d2t stuff |
---|
58 | SINGULAR = /tmp/wawa/Singular/Singular |
---|
59 | SINGULAR_LIB_DIR= ../Singular/LIB |
---|
60 | ifeq ($(SINGUNAME),"ix86-Win") |
---|
61 | LIBPARSE = ${bindir}/libparse.exe |
---|
62 | else |
---|
63 | LIBPARSE = ./libparse |
---|
64 | endif |
---|
65 | DOC_SUBDIR = ./d2t_singular |
---|
66 | EX_SUBDIR = ./examples |
---|
67 | CHKSUM_DB = ${DOC_SUBDIR}/chksum |
---|
68 | DOC2TEX = ${PERL} ./doc2tex.pl -docdir ${DOC_SUBDIR} \ |
---|
69 | -Singular ${SINGULAR} -verbose ${VERBOSE} -make ${MAKE} \ |
---|
70 | -exdir ${EX_SUBDIR} |
---|
71 | PL2DOC = ${PERL} ./pl2doc.pl -db ${CHKSUM_DB} |
---|
72 | |
---|
73 | # t2h stuff |
---|
74 | TMP_DIR = tmp |
---|
75 | HTML_SUBDIR = html |
---|
76 | TEXI2HTML_INIT = t2h_singular.init |
---|
77 | ifeq ($(VERBOSE),0) |
---|
78 | T2H_VERBOSE = |
---|
79 | else |
---|
80 | T2H_VERBOSE = -Verbose |
---|
81 | endif |
---|
82 | TEXI2HTML_OPTS = -init_file ${TEXI2HTML_INIT} -l2h \ |
---|
83 | -short_ext -l2h_tmp ${TMP_DIR} -subdir ${HTML_SUBDIR} \ |
---|
84 | ${T2H_VERBOSE} |
---|
85 | HTML_MANUAL_PREFIX = sing |
---|
86 | HTML_TUTOR_PREFIX = tut |
---|
87 | HTML_MANUAL_TOP = index.htm |
---|
88 | HTML_TUTOR_TOP = tutor.htm |
---|
89 | ## |
---|
90 | ## End configuration dependend stuff |
---|
91 | ################################################################# |
---|
92 | |
---|
93 | ########################################################### |
---|
94 | # File sets |
---|
95 | # |
---|
96 | STANDALONE_TEXI_FILES = COPYING.texi INSTALL_unix.texi NEWS.texi \ |
---|
97 | README_download.texi README_ftp.texi \ |
---|
98 | README_distribution.texi README_src.texi \ |
---|
99 | INSTALL_win.texi |
---|
100 | |
---|
101 | DOC2TEX_FILES = cones.tex countedref.tex decodegb.tex \ |
---|
102 | examples.tex general.tex ti_ip.tex math.tex reference.tex \ |
---|
103 | start.tex types.tex pdata.tex tricks.tex platform.tex \ |
---|
104 | polymake.tex plural.tex letterplace.tex plulibs.tex sca.tex ${PYOBJECT_TEX} |
---|
105 | |
---|
106 | MANUAL_FILES = ${TEX_FILES} ${DOC2TEX_FILES} |
---|
107 | |
---|
108 | TUTOR_FILES = \ |
---|
109 | tutor.tex examples.tex start.tex COPYING.texi |
---|
110 | |
---|
111 | IMAGES_UU := $(wildcard images/*.uu) |
---|
112 | IMAGES := $(IMAGES_UU:images/%.uu=%) |
---|
113 | IMAGES_SRC := $(IMAGES:%=images/%) |
---|
114 | IMAGES_HTML := $(IMAGES:%=${HTML_SUBDIR}/%) |
---|
115 | |
---|
116 | # prepend bindir to path so that programs from there are taken first |
---|
117 | export PATH := "${bindir}:${PATH}" |
---|
118 | |
---|
119 | ########################################################### |
---|
120 | # top targets |
---|
121 | # |
---|
122 | |
---|
123 | .PHONY: info dvi ps html |
---|
124 | |
---|
125 | # default target |
---|
126 | all: info dvi html singular.idx |
---|
127 | |
---|
128 | # info stuff |
---|
129 | info: singular.hlp |
---|
130 | |
---|
131 | singular.hlp: ${MANUAL_FILES} singular.tex s-plural.tex s-plulibs.tex |
---|
132 | - ${MAKEINFO} --no-split singular.tex |
---|
133 | |
---|
134 | # dvi stuff |
---|
135 | dvi: manual.dvi usercard.dvi |
---|
136 | |
---|
137 | singular.dvi: ${MANUAL_FILES} singular.tex s-plural.tex s-plulibs.tex |
---|
138 | tex singular.tex |
---|
139 | texindex singular.cp |
---|
140 | tex singular.tex |
---|
141 | texindex singular.cp |
---|
142 | tex singular.tex |
---|
143 | |
---|
144 | singular.pdf: ${MANUAL_FILES} singular.tex s-plural.tex s-plulibs.tex |
---|
145 | ${TEXI2PDF} singular.tex |
---|
146 | |
---|
147 | manual.dvi: ${MANUAL_FILES} manual.tex s-plural.tex s-plulibs.tex |
---|
148 | tex manual.tex |
---|
149 | texindex manual.cp |
---|
150 | tex manual.tex |
---|
151 | texindex manual.cp |
---|
152 | tex manual.tex |
---|
153 | |
---|
154 | tutor.dvi: ${TUTOR_FILES} |
---|
155 | tex tutor.tex |
---|
156 | tex tutor.tex |
---|
157 | tex tutor.tex |
---|
158 | |
---|
159 | tutor.pdf: ${TUTOR_FILES} |
---|
160 | ${TEXI2PDF} tutor.tex |
---|
161 | |
---|
162 | usercard.dvi: usercard.tex singcard.tex |
---|
163 | ${TEX} $< |
---|
164 | |
---|
165 | s-plural.tex: plural.tex |
---|
166 | sed -e "s/BR_PLURAL_BR/(plural)/g" <plural.tex >s-plural.tex |
---|
167 | |
---|
168 | s-plulibs.tex: plulibs.tex |
---|
169 | sed -e "s/BR_PLURAL_BR/(plural)/g" <plulibs.tex >s-plulibs.tex |
---|
170 | |
---|
171 | # postscript stuff |
---|
172 | ps: dvi manual.ps usercard.ps |
---|
173 | |
---|
174 | usercard.ps: usercard.dvi |
---|
175 | ${DVIPS} -t landscape -t a4 $< -o $@ |
---|
176 | |
---|
177 | %.ps: %.dvi |
---|
178 | ${DVIPS} $< -o $@ |
---|
179 | |
---|
180 | ########################################################### |
---|
181 | # texinfo targets |
---|
182 | # |
---|
183 | manual.tex: ${MANUAL_FILES} doc2tex.pl ${SINGULAR} singular.doc $(STANDALONE_TEXI_FILES) |
---|
184 | +${DOC2TEX} -no_fun -o manual.tex singular.doc |
---|
185 | |
---|
186 | singular.tex: ${MANUAL_FILES} doc2tex.pl ${LIB_TEX_FILES} ${SINGULAR} ${LIBPARSE} singular.doc $(STANDALONE_TEXI_FILES) |
---|
187 | +${DOC2TEX} -o singular.tex singular.doc |
---|
188 | |
---|
189 | #pattern rule for tex files |
---|
190 | %_noEx.tex : %.doc doc2tex.pl ${SINGULAR} |
---|
191 | +${DOC2TEX} -o $@ -no_ex $< |
---|
192 | |
---|
193 | %.tex: %.doc doc2tex.pl ${SINGULAR} |
---|
194 | +${DOC2TEX} -o $@ $< |
---|
195 | |
---|
196 | # pattern rules for lib docus |
---|
197 | ${DOC_SUBDIR}/%_lib.pl : ${SINGULAR_LIB_DIR}/%.lib ${LIBPARSE} |
---|
198 | test -d ${DOC_SUBDIR} || mkdir ${DOC_SUBDIR} |
---|
199 | ${LIBPARSE} -i $< > $@ |
---|
200 | |
---|
201 | %_noFun.doc : %.pl pl2doc.pl |
---|
202 | ${PL2DOC} -no_fun -o $@ $< |
---|
203 | |
---|
204 | %.doc : %.pl pl2doc.pl |
---|
205 | ${PL2DOC} -o $@ $< |
---|
206 | |
---|
207 | # do not delete intermediate .pl and .doc files |
---|
208 | .PRECIOUS: %.doc %_noFun.doc ${DOC_SUBDIR}/%_lib.pl |
---|
209 | |
---|
210 | # index file for help |
---|
211 | singular.idx: singular.hlp ${HTML_SUBDIR}/${HTML_MANUAL_PREFIX}_cp.idx doc2idx.pl |
---|
212 | ${PERL} doc2idx.pl singular.hlp ${HTML_SUBDIR}/${HTML_MANUAL_PREFIX}_cp.idx ${CHKSUM_DB} > singular.idx |
---|
213 | |
---|
214 | ########################################################### |
---|
215 | # stand-alone targest |
---|
216 | # |
---|
217 | |
---|
218 | STANDALONE_TXT_FILES := $(STANDALONE_TEXI_FILES:.texi=.txt) |
---|
219 | STANDALONE_HTML_FILES := $(STANDALONE_TEXI_FILES:.texi=.html) |
---|
220 | STANDALONE_FILES := $(STANDALONE_TEXI_FILES:.texi=) |
---|
221 | |
---|
222 | ifeq ($(SINGUNAME),@SINGUNAME@) |
---|
223 | UNAME_OPT = -D UNAME |
---|
224 | endif |
---|
225 | |
---|
226 | # targets which produce stand-alone documents |
---|
227 | %.${SINGUNAME}.txt : %.texi |
---|
228 | ${MAKEINFO} $(UNAME_OPT) --no-header --paragraph-indent none -o $@ $< |
---|
229 | |
---|
230 | %.txt : %.texi |
---|
231 | ${MAKEINFO} --no-header --paragraph-indent none -o $@ $< |
---|
232 | |
---|
233 | %.${SINGUNAME}.html : %.texi |
---|
234 | ${PERL} ${TEXI2HTML} $(UNAME_OPT) -init_file t2h_standalone.init -split none -out_file $@ $< |
---|
235 | |
---|
236 | %.html : %.texi |
---|
237 | ${PERL} ${TEXI2HTML} -init_file t2h_standalone.init -split none -out_file $@ $< |
---|
238 | |
---|
239 | % : %.txt |
---|
240 | cp $< $@ |
---|
241 | |
---|
242 | standalone: standalone-txt standalone-html ${STANDALONE_FILES} |
---|
243 | |
---|
244 | standalone-html: ${STANDALONE_HTML_FILES} |
---|
245 | standalone-txt: ${STANDALONE_TXT_FILES} |
---|
246 | |
---|
247 | WWW_DIR = /singular/www/2-0/ |
---|
248 | FTP_DIR = /ftp/pub/Math/Singular/Development |
---|
249 | |
---|
250 | install-standalone: standalone |
---|
251 | cp INSTALL_unix.html COPYING.html INSTALL_win.html ${WWW_DIR} |
---|
252 | cp COPYING COPYING.html ${FTP_DIR} |
---|
253 | cp INSTALL_unix INSTALL_unix.html ${FTP_DIR} |
---|
254 | cp INSTALL_win INSTALL_win.html ${FTP_DIR} |
---|
255 | cp README_ftp.html ${FTP_DIR}/README.html |
---|
256 | cp README_ftp ${FTP_DIR}/README |
---|
257 | cp NEWS.html NEWS ${FTP_DIR} |
---|
258 | cp NEWS.html ${WWW_DIR} |
---|
259 | - chmod g+w ${FTP_DIR}/* |
---|
260 | |
---|
261 | |
---|
262 | |
---|
263 | ########################################################### |
---|
264 | # html targets |
---|
265 | # |
---|
266 | html: ${TMP_DIR} ${HTML_SUBDIR}/${HTML_MANUAL_TOP} ${IMAGES_HTML} $(STANDALONE_TEXI_FILES) |
---|
267 | ${HTML_SUBDIR}/${HTML_MANUAL_TOP}: ${TEXI2HTML_INIT} ${TEXI2HTML} singular.tex s-plural.tex |
---|
268 | ${PERL} ${TEXI2HTML} ${TEXI2HTML_OPTS} -prefix ${HTML_MANUAL_PREFIX} \ |
---|
269 | -top_file ${HTML_MANUAL_TOP} singular.tex |
---|
270 | |
---|
271 | # html stuff |
---|
272 | html_tutor: ${TMP_DIR} ${HTML_SUBDIR}/${HTML_TUTOR_TOP} ${IMAGES_HTML} |
---|
273 | ${HTML_SUBDIR}/${HTML_TUTOR_TOP}: ${TEXI2HTML_INIT} ${TEXI2HTML} tutor.tex |
---|
274 | ${PERL} ${TEXI2HTML} ${TEXI2HTML_OPTS} -prefix ${HTML_TUTOR_PREFIX} \ |
---|
275 | -top_file ${HTML_TUTOR_TOP} tutor.tex |
---|
276 | |
---|
277 | ${HTML_SUBDIR}/${HTML_MANUAL_PREFIX}_cp.idx: ${HTML_SUBDIR}/${HTML_MANUAL_TOP} |
---|
278 | |
---|
279 | ${TMP_DIR}: |
---|
280 | ${MKINSTALLDIRS} ${TMP_DIR} |
---|
281 | |
---|
282 | # pattern rules for images - but not everybody has gnu-uudecode |
---|
283 | images/%.gif : images/%.gif.uu |
---|
284 | cd images; ${UUDECODE} ../$< ;cd .. |
---|
285 | |
---|
286 | images/%.jpg : images/%.jpg.uu |
---|
287 | cd images; ${UUDECODE} ../$< ;cd .. |
---|
288 | |
---|
289 | images/%.xbm : images/%.xbm.uu |
---|
290 | cd images; ${UUDECODE} ../$< ;cd .. |
---|
291 | |
---|
292 | ${IMAGES_HTML} : ${IMAGES_SRC} |
---|
293 | test -d ${HTML_SUBDIR} || mkdir ${HTML_SUBDIR} |
---|
294 | cp ${IMAGES_SRC} ${HTML_SUBDIR} |
---|
295 | |
---|
296 | ########################################################### |
---|
297 | # misc targets |
---|
298 | # |
---|
299 | install: singular.hlp html singular.idx standalone |
---|
300 | ${MKINSTALLDIRS} ${infodir} |
---|
301 | ${INSTALL_DATA} singular.hlp ${infodir} |
---|
302 | test -r ${htmldir} || ln -s `pwd`/${HTML_SUBDIR} ${htmldir} |
---|
303 | test -r ${exdir} || ln -s `pwd`/${EX_SUBDIR} ${exdir} |
---|
304 | |
---|
305 | install_all: install |
---|
306 | |
---|
307 | uninstall: |
---|
308 | rm -f ${infodir}/singular.hlp |
---|
309 | - rmdir ${infodir} |
---|
310 | |
---|
311 | #stupid HP's don't allow copy with many arguments |
---|
312 | install-sharedist: singular.hlp html singular.idx \ |
---|
313 | ${STANDALONE_HTML_FILES} ${STANDALONE_TXT_FILES} |
---|
314 | ${MKINSTALLDIRS} ${install_prefix} |
---|
315 | ${MKINSTALLDIRS} ${install_infodir} |
---|
316 | ${INSTALL_DATA} singular.hlp ${install_infodir} |
---|
317 | chmod -R +rX ${install_infodir} |
---|
318 | ${MKINSTALLDIRS} ${install_htmldir} |
---|
319 | cp ${HTML_SUBDIR}/*.htm ${install_htmldir} |
---|
320 | cp ${HTML_SUBDIR}/*.gif ${install_htmldir} |
---|
321 | -cp ${HTML_SUBDIR}/*.png ${install_htmldir} |
---|
322 | cp ${HTML_SUBDIR}/*.jpg ${install_htmldir} |
---|
323 | chmod -R +rX ${install_htmldir} |
---|
324 | ${MKINSTALLDIRS} ${install_docdir} |
---|
325 | ${INSTALL_DATA} singular.idx ${install_docdir} |
---|
326 | ${INSTALL_DATA} ../GPL2 ${install_prefix}/GPL2 |
---|
327 | ${INSTALL_DATA} ../GPL3 ${install_prefix}/GPL3 |
---|
328 | ${INSTALL_DATA} COPYING.txt ${install_prefix}/COPYING |
---|
329 | ${INSTALL_DATA} COPYING.html ${install_prefix} |
---|
330 | ${INSTALL_DATA} NEWS.txt ${install_prefix}/NEWS |
---|
331 | ${INSTALL_DATA} NEWS.html ${install_prefix} |
---|
332 | ${INSTALL_DATA} README_distribution.txt ${install_prefix}/README |
---|
333 | ${INSTALL_DATA} README_distribution.html ${install_prefix}/README.html |
---|
334 | chmod -R +rX ${install_docdir} |
---|
335 | chmod -R +rX ${install_prefix} |
---|
336 | ${MKINSTALLDIRS} ${install_exdir} |
---|
337 | cp -R examples ${install_prefix} |
---|
338 | /bin/rm -f ${install_prefix}/examples/[A-Z]*.res |
---|
339 | /bin/rm -f ${install_prefix}/examples/*.res |
---|
340 | /bin/rm -f ${install_prefix}/examples/[A-Z]*.inc |
---|
341 | /bin/rm -f ${install_prefix}/examples/*.inc |
---|
342 | chmod -R +rX ${install_prefix}/ |
---|
343 | |
---|
344 | # use 'make INSTALL_unix.olaf.txt INSTALL_unix.olaf.html SINGUNAME=olaf' |
---|
345 | # to generate these files for uname 'olaf' |
---|
346 | install-bindist: INSTALL_unix.${SINGUNAME}.txt INSTALL_unix.${SINGUNAME}.html |
---|
347 | ${MKINSTALLDIRS} ${install_prefix} |
---|
348 | ${INSTALL_DATA} INSTALL_unix.${SINGUNAME}.txt ${install_prefix}/INSTALL |
---|
349 | ${INSTALL_DATA} INSTALL_unix.${SINGUNAME}.html ${install_prefix}/INSTALL.html |
---|
350 | |
---|
351 | install-ftp: ${STANDALONE_HTML_FILES} ${STANDALONE_TXT_FILES} |
---|
352 | ${INSTALL_DATA} NEWS.txt ${ftpdir}/NEWS |
---|
353 | ${INSTALL_DATA} NEWS.html ${ftpdir} |
---|
354 | ${INSTALL_DATA} COPYING.txt ${ftpdir}/COPYING |
---|
355 | ${INSTALL_DATA} COPYING.html ${ftpdir} |
---|
356 | ${INSTALL_DATA} INSTALL_unix.txt ${ftpdir}/INSTALL_unix |
---|
357 | ${INSTALL_DATA} INSTALL_unix.html ${ftpdir} |
---|
358 | ${INSTALL_DATA} README_ftp.txt ${ftpdir}/README |
---|
359 | ${INSTALL_DATA} README_ftp.html ${ftpdir}/README.html |
---|
360 | |
---|
361 | texi2html = $(TEXI2HTML:%.pl=%) |
---|
362 | |
---|
363 | lib2doc.tar.gz: |
---|
364 | rm -rf lib2doc lib2doc.tar.gz |
---|
365 | mkdir lib2doc |
---|
366 | cp Makefile.lib2doc lib2doc/Makefile |
---|
367 | ${MAKEINFO} --no-header --paragraph-indent none -o lib2doc/README lib2doc.texi |
---|
368 | cp pl2doc.pl doc2tex.pl ${texi2html} lib2doc |
---|
369 | tar cf lib2doc.tar lib2doc |
---|
370 | ${GZIP} lib2doc.tar |
---|
371 | |
---|
372 | clean: mostlyclean |
---|
373 | /bin/rm -rf singular.tex manual.tex ${DOC_SUBDIR} ${EX_SUBDIR} |
---|
374 | |
---|
375 | mostlyclean: |
---|
376 | /bin/rm -f .singular_hist doe.tmp dump.ascii example.mp example.txt |
---|
377 | /bin/rm -f save_i test.ascii test.mp |
---|
378 | /bin/rm -f Z* *.tst *.pag *.dir *.lst *.log *.aux *.cp *.cps |
---|
379 | /bin/rm -f *.fn *.fns *.ky *.kys *.log *.pg *.pgs *.toc *.tp |
---|
380 | /bin/rm -f *.tps *.vr *.vrs *.dvi *.ps |
---|
381 | /bin/rm -f s-plural.tex |
---|
382 | /bin/rm -f singular.hlp manual.hlp ${DOC2TEX_FILES} singular.idx |
---|
383 | /bin/rm -f manual.hlp |
---|
384 | /bin/rm -f ${HTML_SUBDIR}/${HTML_MANUAL_TOP} ${HTML_SUBDIR}/${HTML_TUTOR_TOP} |
---|
385 | /bin/rm -rf ${STANDALONE_HTML_FILES} ${STANDALONE_FILES} ${STANDALONE_TXT_FILES} |
---|
386 | /bin/rm -f INSTALL_unix.${SINGUNAME}.txt INSTALL_unix.${SINGUNAME}.html |
---|
387 | |
---|
388 | distclean: clean |
---|
389 | /bin/rm -f Makefile |
---|
390 | /bin/rm -rf ${HTML_SUBDIR} ../html ../examples |
---|
391 | |
---|
392 | maintainer-clean: distclean |
---|
393 | |
---|
394 | depend: |
---|
395 | @echo "No make depend available!" |
---|
396 | |
---|
397 | ${SINGULAR}: |
---|
398 | # cd ..; ${MAKE} ${SINGULAR} |
---|
399 | |
---|
400 | Makefile: Makefile.in |
---|
401 | cd ..; CONFIG_FILES="doc/Makefile" CONFIG_HEADERS= ./config.status |
---|
402 | |
---|
403 | html-done: ${MANUAL_FILES} |
---|