source: git/doc/Makefile.bsp @ 7976de8

jengelh-datetimespielwiese
Last change on this file since 7976de8 was 7976de8, checked in by Hans Schoenemann <hannes@…>, 10 years ago
add: example Makefile
  • Property mode set to 100644
File size: 12.0 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
14PYOBECT_TEX =
15#PYOBECT_TEX = pyobject.tex
16
17
18## directory where info files are installed
19prefix          = /tmp/wawa
20infodir         = ${prefix}/info
21bindir          = @bindir@
22htmldir         = ${prefix}/html
23exdir           = ${prefix}/examples
24
25localdir        = /usr/local
26install_prefix  = ${localdir}/Singular/${S_VERSION}
27install_infodir = ${install_prefix}/info
28install_htmldir = ${install_prefix}/html
29install_docdir  = ${install_prefix}/doc
30install_exdir   = ${install_prefix}/examples
31
32# directory where files for ftp site go
33ftpdir          = /tmp
34
35##
36## needed programs
37##
38LN_S            = @LN_S@
39INSTALL         = ../install-sh -c
40INSTALL_PROGRAM = ${INSTALL}
41INSTALL_DATA    = ${INSTALL} -m 644
42MKINSTALLDIRS   = mkdir -p
43GZIP            = gzip
44UUDECODE        = uudecode
45
46PERL            = perl
47TEX             = tex
48MAKEINFO        = makeinfo --force
49TEXI2PDF        = @TEXI2PDF@
50TEXINDEX        = @TEXINDEX@
51# use our local texi2html
52TEXI2HTML       = ./texi2html
53DVIPS           = dvips
54
55VERBOSE         = 1 # override this with make VERBOSE=2
56
57# d2t stuff
58SINGULAR        = /tmp/wawa/Singular/Singular
59SINGULAR_LIB_DIR= ../Singular/LIB
60ifeq ($(SINGUNAME),"ix86-Win")
61LIBPARSE        = ${bindir}/libparse.exe
62else
63LIBPARSE        = ./libparse
64endif
65DOC_SUBDIR      = ./d2t_singular
66EX_SUBDIR       = ./examples
67CHKSUM_DB       = ${DOC_SUBDIR}/chksum
68DOC2TEX         = ${PERL} ./doc2tex.pl -docdir ${DOC_SUBDIR} \
69                  -Singular ${SINGULAR} -verbose ${VERBOSE} -make ${MAKE} \
70                  -exdir ${EX_SUBDIR}
71PL2DOC          = ${PERL} ./pl2doc.pl -db ${CHKSUM_DB}
72
73# t2h stuff
74TMP_DIR         = tmp
75HTML_SUBDIR     = html
76TEXI2HTML_INIT  = t2h_singular.init
77ifeq ($(VERBOSE),0)
78T2H_VERBOSE     =
79else
80T2H_VERBOSE     = -Verbose
81endif
82TEXI2HTML_OPTS  = -init_file ${TEXI2HTML_INIT} -l2h \
83                  -short_ext -l2h_tmp ${TMP_DIR} -subdir ${HTML_SUBDIR} \
84                  ${T2H_VERBOSE}
85HTML_MANUAL_PREFIX = sing
86HTML_TUTOR_PREFIX  = tut
87HTML_MANUAL_TOP    = index.htm
88HTML_TUTOR_TOP     = tutor.htm
89##
90## End configuration dependend stuff
91#################################################################
92
93###########################################################
94# File sets
95#
96STANDALONE_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
101DOC2TEX_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
106MANUAL_FILES    = ${TEX_FILES} ${DOC2TEX_FILES}
107
108TUTOR_FILES     = \
109                tutor.tex examples.tex start.tex COPYING.texi
110
111IMAGES_UU       := $(wildcard images/*.uu)
112IMAGES     := $(IMAGES_UU:images/%.uu=%)
113IMAGES_SRC := $(IMAGES:%=images/%)
114IMAGES_HTML := $(IMAGES:%=${HTML_SUBDIR}/%)
115
116# prepend bindir to path so that programs from there are taken first
117export PATH := "${bindir}:${PATH}"
118
119###########################################################
120# top targets
121#
122
123.PHONY: info dvi ps html
124
125# default target
126all: info dvi html singular.idx
127
128# info stuff
129info: singular.hlp
130
131singular.hlp: ${MANUAL_FILES} singular.tex s-plural.tex s-plulibs.tex
132        - ${MAKEINFO} --no-split singular.tex
133
134# dvi stuff
135dvi: manual.dvi usercard.dvi
136
137singular.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
144singular.pdf: ${MANUAL_FILES} singular.tex s-plural.tex s-plulibs.tex
145        ${TEXI2PDF} singular.tex
146
147manual.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
154tutor.dvi: ${TUTOR_FILES}
155        tex tutor.tex
156        tex tutor.tex
157        tex tutor.tex
158
159tutor.pdf: ${TUTOR_FILES}
160        ${TEXI2PDF} tutor.tex
161
162usercard.dvi: usercard.tex singcard.tex
163        ${TEX} $<
164
165s-plural.tex: plural.tex
166        sed -e "s/BR_PLURAL_BR/(plural)/g" <plural.tex >s-plural.tex
167
168s-plulibs.tex: plulibs.tex
169        sed -e "s/BR_PLURAL_BR/(plural)/g" <plulibs.tex >s-plulibs.tex
170
171# postscript stuff
172ps: dvi manual.ps usercard.ps
173
174usercard.ps: usercard.dvi
175        ${DVIPS} -t landscape -t a4 $< -o $@
176
177%.ps: %.dvi
178        ${DVIPS} $< -o $@
179
180###########################################################
181# texinfo targets
182#
183manual.tex:  ${MANUAL_FILES} doc2tex.pl ${SINGULAR} singular.doc $(STANDALONE_TEXI_FILES)
184        +${DOC2TEX} -no_fun -o manual.tex singular.doc
185
186singular.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
211singular.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
218STANDALONE_TXT_FILES := $(STANDALONE_TEXI_FILES:.texi=.txt)
219STANDALONE_HTML_FILES := $(STANDALONE_TEXI_FILES:.texi=.html)
220STANDALONE_FILES      := $(STANDALONE_TEXI_FILES:.texi=)
221
222ifeq ($(SINGUNAME),@SINGUNAME@)
223UNAME_OPT = -D UNAME
224endif
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
242standalone: standalone-txt standalone-html ${STANDALONE_FILES}
243
244standalone-html: ${STANDALONE_HTML_FILES}
245standalone-txt:  ${STANDALONE_TXT_FILES}
246
247WWW_DIR = /singular/www/2-0/
248FTP_DIR = /ftp/pub/Math/Singular/Development
249
250install-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#
266html: ${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
272html_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
283images/%.gif : images/%.gif.uu
284        cd images; ${UUDECODE} ../$< ;cd ..
285
286images/%.jpg : images/%.jpg.uu
287        cd images; ${UUDECODE} ../$< ;cd ..
288
289images/%.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#
299install: 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
305install_all: install
306
307uninstall:
308        rm -f ${infodir}/singular.hlp
309        - rmdir ${infodir}
310
311#stupid HP's don't allow copy with many arguments
312install-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'
346install-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
351install-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
361texi2html = $(TEXI2HTML:%.pl=%)
362
363lib2doc.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
372clean: mostlyclean
373        /bin/rm -rf singular.tex manual.tex ${DOC_SUBDIR} ${EX_SUBDIR}
374
375mostlyclean:
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
388distclean: clean
389        /bin/rm -f Makefile
390        /bin/rm -rf ${HTML_SUBDIR} ../html ../examples
391
392maintainer-clean: distclean
393
394depend:
395        @echo "No make depend available!"
396
397${SINGULAR}:
398#       cd ..; ${MAKE} ${SINGULAR}
399
400Makefile: Makefile.in
401        cd ..;  CONFIG_FILES="doc/Makefile" CONFIG_HEADERS= ./config.status
402
403html-done: ${MANUAL_FILES}
Note: See TracBrowser for help on using the repository browser.