source: git/doc/Makefile.bsp @ ba5e9e

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