1 | ##################################################################### |
---|
2 | ### |
---|
3 | ### Makefile for Singular documentation |
---|
4 | ### |
---|
5 | ##################################################################### |
---|
6 | SHELL=/bin/sh |
---|
7 | |
---|
8 | #################################################################### |
---|
9 | ## |
---|
10 | ## Configuration |
---|
11 | ## |
---|
12 | |
---|
13 | ## directory where info files are installed |
---|
14 | prefix = @prefix@ |
---|
15 | infodir = ${prefix}/info |
---|
16 | bindir = @bindir@ |
---|
17 | htmldir = ${prefix}/html |
---|
18 | |
---|
19 | ## |
---|
20 | ## needed programs |
---|
21 | ## |
---|
22 | @SET_MAKE@ |
---|
23 | CC = @CC@ |
---|
24 | INSTALL = ../install-sh -c |
---|
25 | INSTALL_PROGRAM = ${INSTALL} |
---|
26 | INSTALL_DATA = ${INSTALL} -m 644 |
---|
27 | MKINSTALLDIRS = ../mkinstalldirs |
---|
28 | |
---|
29 | PERL5 = @PERL5@ |
---|
30 | TEX = tex |
---|
31 | MAKEINFO = @MAKEINFO@ |
---|
32 | TEXI2DVI = @TEXI2DVI@ |
---|
33 | TEXINDEX = @TEXINDEX@ |
---|
34 | TEXI2HTML = @TEXI2HTML@ |
---|
35 | DVIPS = dvips |
---|
36 | IMAGES_UU := $(wildcard images/*.uu) |
---|
37 | |
---|
38 | # d2t stuff |
---|
39 | SINGULAR = @SINGULAR@ |
---|
40 | LIBPARSE = ${bindir}/libparse |
---|
41 | D2T_SUBDIR = ./d2t_singular |
---|
42 | DOC2TEX = ./doc2tex.pl -subdir ${D2T_SUBDIR} -Singular ${SINGULAR} \ |
---|
43 | -libparse ${LIBPARSE} -I ../Singular/LIB |
---|
44 | TMP_DIR = @TMP_DIR@ |
---|
45 | TEXI2HTML_OPTS = @TEXI2HTML_OPTS@ -l2h_tmp ${TMP_DIR} |
---|
46 | ## |
---|
47 | ## End configuration dependend stuff |
---|
48 | ################################################################# |
---|
49 | |
---|
50 | # files |
---|
51 | TEX_FILES = copyright.tex |
---|
52 | DOC2TEX_FILES = \ |
---|
53 | examples.tex general.tex math.tex reference.tex \ |
---|
54 | start.tex types.tex pdata.tex tricks.tex |
---|
55 | |
---|
56 | MANUAL_FILES = ${TEX_FILES} ${DOC2TEX_FILES} |
---|
57 | TUTOR_FILES = \ |
---|
58 | tutor.tex examples.tex start.tex copyright.tex |
---|
59 | |
---|
60 | IMAGES := $(IMAGES_UU:images/%.uu=%) |
---|
61 | IMAGES_SRC := $(IMAGES:%=images/%) |
---|
62 | IMAGES_HTML := $(IMAGES:%=html/%) |
---|
63 | IMAGES_TUTOR := $(IMAGES:%=html_tutor/%) |
---|
64 | |
---|
65 | # prepend bindir to path so that programs from there are taken first |
---|
66 | export PATH := "${bindir}:${PATH}" |
---|
67 | |
---|
68 | .PHONY: info dvi ps |
---|
69 | # default target |
---|
70 | all: info dvi html |
---|
71 | |
---|
72 | # info stuff |
---|
73 | info: singular.hlp |
---|
74 | |
---|
75 | singular.hlp: ${MANUAL_FILES} singular.tex |
---|
76 | - ${MAKEINFO} --no-split singular.tex |
---|
77 | |
---|
78 | # dvi stuff |
---|
79 | dvi: manual.dvi usercard.dvi |
---|
80 | |
---|
81 | singular.dvi: ${MANUAL_FILES} singular.tex |
---|
82 | ${TEXI2DVI} singular.tex |
---|
83 | |
---|
84 | manual.dvi: ${MANUAL_FILES} manual.tex |
---|
85 | ${TEXI2DVI} manual.tex |
---|
86 | |
---|
87 | tutor.dvi: ${TUTOR_FILES} |
---|
88 | ${TEXI2DVI} tutor.tex |
---|
89 | |
---|
90 | usercard.dvi: usercard.tex singcard.tex |
---|
91 | ${TEX} $< |
---|
92 | |
---|
93 | # postscript stuff |
---|
94 | ps: singular.ps usercard.ps |
---|
95 | |
---|
96 | usercard.ps: usercard.dvi |
---|
97 | ${DVIPS} -t landscape -t a4 $< -o $@ |
---|
98 | |
---|
99 | %.ps: %.dvi |
---|
100 | ${DVIPS} $< -o $@ |
---|
101 | |
---|
102 | # html stuff |
---|
103 | html: html/index.htm ${IMAGES_HTML} |
---|
104 | html/index.htm: t2h_singular.init t2h.init singular.tex singular.hlp ${TEXI2HTML} |
---|
105 | ${PERL5} ${TEXI2HTML} -init_file t2h_singular.init ${TEXI2HTML_OPTS} -subdir html singular.tex |
---|
106 | |
---|
107 | # html stuff |
---|
108 | html_tutor: ${TUTOR_FILES} ${IMAGES_TUTOR} |
---|
109 | test -d html_tutor || mkdir html_tutor |
---|
110 | cd html_tutor && ${PERL5} ${TEXI2HTML} ${TEXI2HTML_OPTS} ../tutor.tex |
---|
111 | test -d html || mkdir html |
---|
112 | test -d html/images || mkdir html/images |
---|
113 | for img in ${IMAGES}; \ |
---|
114 | do \ |
---|
115 | echo uudecode images/$${img}.uu; \ |
---|
116 | uudecode images/$${img}.uu; \ |
---|
117 | done |
---|
118 | test -e html_tutor/images || (cd html_tutor; ln -s ../html/images images) |
---|
119 | touch html_tutor |
---|
120 | |
---|
121 | # how to create the texinfo files |
---|
122 | manual.tex: ${MANUAL_FILES} doc2tex.pl ${SINGULAR} ${LIBPARSE} singular.doc |
---|
123 | ${PERL5} ${DOC2TEX} -o manual.tex singular.doc |
---|
124 | |
---|
125 | singular.tex: ${MANUAL_FILES} doc2tex.pl ${SINGULAR} ${LIBPARSE} singular.doc |
---|
126 | ${PERL5} ${DOC2TEX} -lib_fun -lib_ex -o singular.tex singular.doc |
---|
127 | |
---|
128 | %.tex: %.doc doc2tex.pl ${SINGULAR} ${LIBPARSE} |
---|
129 | ${PERL5} ${DOC2TEX} $* |
---|
130 | |
---|
131 | # targets which produce stand-alone documents |
---|
132 | COPYING: copyright.tex |
---|
133 | ${MAKEINFO} --no-header -o COPYING copyright.tex |
---|
134 | |
---|
135 | ${IMAGES_HTML} : ${IMAGES_SRC} |
---|
136 | test -d html || mkdir html |
---|
137 | cp ${IMAGES_SRC} html |
---|
138 | |
---|
139 | ${IMAGES_TUTOR} : ${IMAGES_SRC} |
---|
140 | test -d html_tutor || mkdir html_tutor |
---|
141 | cp ${IMAGES_SRC} html_tutor |
---|
142 | |
---|
143 | images/%.gif : images/%.gif.uu |
---|
144 | uudecode $< -o $@ |
---|
145 | |
---|
146 | images/%.jpg : images/%.jpg.uu |
---|
147 | uudecode $< -o $@ |
---|
148 | |
---|
149 | images/%.xbm : images/%.xbm.uu |
---|
150 | uudecode $< -o $@ |
---|
151 | |
---|
152 | # targets concerned with maintenance |
---|
153 | install: singular.hlp html/index.htm |
---|
154 | ${MKINSTALLDIRS} ${infodir} |
---|
155 | ${INSTALL_DATA} singular.hlp ${infodir} |
---|
156 | test -L ${htmldir} || (rm -rf ${htmldir}; ln -s `pwd`/html ${htmldir}) |
---|
157 | |
---|
158 | uninstall: |
---|
159 | rm -f ${infodir}/singular.hlp |
---|
160 | - rmdir ${infodir} |
---|
161 | |
---|
162 | clean: |
---|
163 | /bin/rm -f .singular_hist doe.tmp dump.ascii example.mp example.txt |
---|
164 | /bin/rm -f save_i test.ascii test.mp |
---|
165 | /bin/rm -f Z* *.tst *.pag *.dir *.lst *.log *.aux *.cp *.cps |
---|
166 | /bin/rm -f *.fn *.fns *.ky *.kys *.log *.pg *.pgs *.toc *.tp |
---|
167 | /bin/rm -f *.tps *.vr *.vrs |
---|
168 | /bin/rm -f singular.hlp *.dvi *.ps ${DOC2TEX_FILES} |
---|
169 | /bin/rm -rf singular.tex manual.tex html ${D2T_SUBDIR} |
---|
170 | |
---|
171 | mostlyclean: clean |
---|
172 | |
---|
173 | distclean: mostlyclean |
---|
174 | /bin/rm -f Makefile |
---|
175 | |
---|
176 | maintainer-clean: distclean |
---|
177 | |
---|
178 | ${SINGULAR}: |
---|
179 | # cd ..; ${MAKE} ${SINGULAR} |
---|
180 | |
---|
181 | Makefile: Makefile.in |
---|
182 | cd ..; ${MAKE} doc/Makefile |
---|
183 | |
---|
184 | html-done: ${MANUAL_FILES} |
---|
185 | |
---|