source: git/doc/Makefile.in @ f940e2

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