source: git/doc/Makefile.bsp @ b0e913

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