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