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