source: git/doc/Makefile-docbuild.in @ 26a278d

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