1 | ################################################################# |
---|
2 | ### |
---|
3 | ### Makefile for Singular |
---|
4 | ### |
---|
5 | ################################################################# |
---|
6 | |
---|
7 | SHELL = /bin/sh |
---|
8 | |
---|
9 | ## |
---|
10 | ## versions |
---|
11 | ## |
---|
12 | SINGULAR_MAJOR_VERSION = @SINGULAR_MAJOR_VERSION@ |
---|
13 | SINGULAR_MINOR_VERSION = @SINGULAR_MINOR_VERSION@ |
---|
14 | DIST_NAME = Singular-${SINGULAR_MAJOR_VERSION}.${SINGULAR_MINOR_VERSION} |
---|
15 | |
---|
16 | ## |
---|
17 | ## various paths |
---|
18 | ## |
---|
19 | srcdir = @srcdir@ |
---|
20 | prefix = @prefix@ |
---|
21 | exec_prefix = @exec_prefix@ |
---|
22 | libdir = @libdir@ |
---|
23 | # program executable goes here |
---|
24 | bindir = @bindir@ |
---|
25 | # Singular libs go here |
---|
26 | singulardatadir = @singulardatadir@ |
---|
27 | includedir = @includedir@ |
---|
28 | |
---|
29 | ## |
---|
30 | ## various programs |
---|
31 | ## |
---|
32 | CC = @CC@ |
---|
33 | CXX = @CXX@ |
---|
34 | BISON = bison |
---|
35 | LEX = flex |
---|
36 | @SET_MAKE@ |
---|
37 | INSTALL = ./install-sh -c |
---|
38 | INSTALL_PROGRAM = ${INSTALL} |
---|
39 | INSTALL_DATA = ${INSTALL} -m 644 |
---|
40 | MKINSTALLDIRS = ./mkinstalldirs |
---|
41 | |
---|
42 | ## |
---|
43 | ## compiler and linker options |
---|
44 | ## |
---|
45 | CFLAGS = @CFLAGS@ |
---|
46 | CXXFLAGS = @CXXFLAGS@ |
---|
47 | CXXNOOPTFLAGS = @CXXNOOPTFLAGS@ |
---|
48 | CXXTEMPLFLAGS = @CXXTEMPLFLAGS@ |
---|
49 | CPPFLAGS = -I${srcdir} @CPPFLAGS@ |
---|
50 | DEFS = @DEFS@ -DNDEBUG |
---|
51 | LDFLAGS = @LDFLAGS@ |
---|
52 | LIBS = @NEED_LIBS@ |
---|
53 | |
---|
54 | ## |
---|
55 | ## subdirectories |
---|
56 | ## |
---|
57 | # where the doumentation files are |
---|
58 | docdir = doc |
---|
59 | # where the tests files are |
---|
60 | testdir = tests |
---|
61 | |
---|
62 | ## |
---|
63 | ## the configuration |
---|
64 | ## |
---|
65 | WITH_MP = @WITH_MP@ |
---|
66 | WITH_FACTORY = @WITH_FACTORY@ |
---|
67 | WITH_LIBFAC = @WITH_LIBFAC@ |
---|
68 | |
---|
69 | ## |
---|
70 | ## End configuration dependend stuff |
---|
71 | ################################################################# |
---|
72 | |
---|
73 | ### |
---|
74 | ### file sets |
---|
75 | ### |
---|
76 | |
---|
77 | CXXSOURCES=grammar.cc scanner.cc algmap.cc attrib.cc binom.cc clapconv.cc \ |
---|
78 | clapmem.cc clapsing.cc claptmpl.cc cntrlc.cc \ |
---|
79 | extra.cc febase.cc feread.cc \ |
---|
80 | ffields.cc hdegree.cc hilb.cc hutil.cc \ |
---|
81 | ideals.cc intvec.cc iparith.cc \ |
---|
82 | ipassign.cc ipconv.cc ipid.cc iplib.cc \ |
---|
83 | ipprint.cc ipshell.cc khstd.cc kstdfac.cc \ |
---|
84 | kstd1.cc kstd2.cc kutil.cc lists.cc \ |
---|
85 | longalg.cc longrat.cc \ |
---|
86 | longrat0.cc maps.cc matpol.cc misc.cc \ |
---|
87 | mminit.cc modulop.cc \ |
---|
88 | fglm.cc fglmzero.cc fglmvec.cc \ |
---|
89 | numbers.cc polys.cc polys0.cc polys1.cc polys2.cc \ |
---|
90 | ring.cc shortfl.cc silink.cc sing_mp.cc\ |
---|
91 | sing_dld.cc sing_dbm.cc spolys.cc spolys0.cc \ |
---|
92 | subexpr.cc syz.cc syz0.cc syz1.cc \ |
---|
93 | tesths.cc timer.cc weight.cc \ |
---|
94 | mpsr_Put.cc mpsr_PutPoly.cc mpsr_Tok.cc mpsr_GetPoly.cc \ |
---|
95 | mpsr_Get.cc mpsr_GetMisc.cc mpsr_Error.cc |
---|
96 | |
---|
97 | CSOURCES=mmalloc.c mmallocb.c mmallocs.c mmblock.c mmheap.c mmspec.c mmutil.c |
---|
98 | |
---|
99 | SOURCES=${CSOURCES} ${CXXSOURCES} grammar.y scanner.l |
---|
100 | |
---|
101 | HEADERS=algmap.h hutil.h lists.h stairc.h attrib.h ideals.h \ |
---|
102 | longalg.h mpsr_Tok.h structs.h binom.h intvec.h longrat.h \ |
---|
103 | numbers.h stype.h clapconv.h ipconv.h maps.h page.h \ |
---|
104 | subexpr.h clapsing.h ipid.h matpol.h polys.h syz.h \ |
---|
105 | cntrlc.h ipprint.h mmemory.h ring.h timer.h \ |
---|
106 | febase.h ipshell.h mmprivat.h shortfl.h tok.h \ |
---|
107 | ffields.h khstd.h silink.h \ |
---|
108 | fglm.h kstd1.h modulop.h sing_dbm.h weight.h \ |
---|
109 | fglmvec.h kstd2.h mpsr.h sing_mp.h \ |
---|
110 | kstdfac.h mpsr_Get.h spolys.h \ |
---|
111 | kutil.h mpsr_Put.h spolys0.h |
---|
112 | |
---|
113 | TESTS=${testdir}/check ${testdir}/input ${testdir}/output |
---|
114 | |
---|
115 | DOCS=${docdir}/Makefile.in ${docdir}/copyright.tex ${docdir}/doc2tex.c \ |
---|
116 | ${docdir}/examples.doc ${docdir}/examples.tex ${docdir}/proc.tex \ |
---|
117 | ${docdir}/singular.doc ${docdir}/start.doc \ |
---|
118 | ${docdir}/start.tex ${docdir}/tutor.tex ${docdir}/singular.tex |
---|
119 | |
---|
120 | DISTFILES=${SOURCES} ${HEADERS} Makefile.in configure.in configure \ |
---|
121 | mod2.h.in grammar.h testgh install-sh mkinstalldirs \ |
---|
122 | ${TESTS} ${DOCS} |
---|
123 | |
---|
124 | OBJS=grammar.o scanner.o matpol.o binom.o\ |
---|
125 | febase.o feread.o timer.o intvec.o attrib.o lists.o\ |
---|
126 | longrat.o longrat0.o misc.o ring.o numbers.o maps.o\ |
---|
127 | hilb.o kstd1.o kstd2.o kutil.o khstd.o kstdfac.o modulop.o spolys.o\ |
---|
128 | ideals.o subexpr.o hdegree.o hutil.o ffields.o shortfl.o \ |
---|
129 | longalg.o spolys0.o syz.o syz0.o syz1.o weight.o \ |
---|
130 | ipid.o ipshell.o iplib.o ipassign.o ipconv.o ipprint.o\ |
---|
131 | polys.o polys0.o polys1.o polys2.o extra.o\ |
---|
132 | mminit.o mmutil.o mmalloc.o mmallocb.o mmallocs.o \ |
---|
133 | mmspec.o mmblock.o mmheap.o sing_dld.o sing_dbm.o silink.o \ |
---|
134 | sing_mp.o fglm.o fglmzero.o fglmvec.o cntrlc.o \ |
---|
135 | algmap.o clapconv.o clapmem.o clapsing.o claptmpl.o\ |
---|
136 | mpsr_Error.o mpsr_Put.o mpsr_PutPoly.o mpsr_GetPoly.o \ |
---|
137 | mpsr_Get.o mpsr_GetMisc.o |
---|
138 | |
---|
139 | ## |
---|
140 | ## PRIMARY Targets |
---|
141 | ## |
---|
142 | |
---|
143 | |
---|
144 | .l.cc: |
---|
145 | ${LEX} -s -I -t $< > scanner.cc |
---|
146 | |
---|
147 | .y.cc: |
---|
148 | ${BISON} -d -t -o grammar.cc $< |
---|
149 | chmod +x testgh |
---|
150 | ./testgh |
---|
151 | |
---|
152 | .cc.o: |
---|
153 | ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} -c $< |
---|
154 | .c.o: |
---|
155 | ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $< |
---|
156 | |
---|
157 | all: Singular |
---|
158 | |
---|
159 | Singular: mod2.h Makefile version.h scanner.cc ${OBJS} iparith.o \ |
---|
160 | mpsr_Tok.o tesths.cc |
---|
161 | ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -o Singular \ |
---|
162 | tesths.cc iparith.o mpsr_Tok.o ${OBJS} ${LDFLAGS} ${LIBS} |
---|
163 | |
---|
164 | iparith.o mpsr_Tok.o : iparith.inc mpsr_Tok.inc |
---|
165 | |
---|
166 | claptmpl.o: claptmpl.cc mod2.h |
---|
167 | ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -c $< |
---|
168 | |
---|
169 | weight.o: weight.cc mod2.h |
---|
170 | ${CXX} ${CXXNOOPTFLAGS} ${CPPFLAGS} ${DEFS} -c $< |
---|
171 | |
---|
172 | iparith.inc mpsr_Tok.inc : iparith.cc ipconv.cc tok.h mpsr_Tok.cc grammar.h |
---|
173 | ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -DGENTABLE -o gentable \ |
---|
174 | iparith.cc tesths.cc mpsr_Tok.cc ${OBJS} ${LDFLAGS} ${LIBS} |
---|
175 | ./gentable |
---|
176 | /bin/rm gentable |
---|
177 | |
---|
178 | version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in configure.in |
---|
179 | echo "#define SINGULAR_VERSION_ID " `date '+%y%m%d%H'` >version.h |
---|
180 | |
---|
181 | mod2.h: stamp-h |
---|
182 | |
---|
183 | stamp-h : config.status mod2.h.in |
---|
184 | CONFIG_FILES= CONFIG_HEADERS=mod2.h ./config.status |
---|
185 | |
---|
186 | Makefile: Makefile.in config.status |
---|
187 | CONFIG_FILES="Makefile" CONFIG_HEADERS= ./config.status |
---|
188 | |
---|
189 | doc/Makefile: doc/Makefile.in config.status |
---|
190 | CONFIG_FILES="doc/Makefile" CONFIG_HEADERS= ./config.status |
---|
191 | |
---|
192 | config.status: configure |
---|
193 | ./config.status --recheck |
---|
194 | |
---|
195 | configure: configure.in |
---|
196 | @echo "WARNING: You need to rerun autoconf. I am proceeding, for now." |
---|
197 | touch configure |
---|
198 | # autoconf |
---|
199 | |
---|
200 | ## |
---|
201 | ## install targets |
---|
202 | ## |
---|
203 | install: all installbin installdata installinfo |
---|
204 | |
---|
205 | installbin: Singular |
---|
206 | ${MKINSTALLDIRS} ${bindir} |
---|
207 | ${INSTALL_PROGRAM} Singular ${bindir} |
---|
208 | |
---|
209 | installdata: |
---|
210 | ${MKINSTALLDIRS} ${singulardatadir} |
---|
211 | ${MKINSTALLDIRS} ${singulardatadir}/gftables |
---|
212 | for file in ${srcdir}/LIB/gftables/[0-9]*; do \ |
---|
213 | ${INSTALL_DATA} $${file} ${singulardatadir}/gftables; \ |
---|
214 | done |
---|
215 | for file in ${srcdir}/LIB/*.lib; do \ |
---|
216 | ${INSTALL_DATA} $${file} ${singulardatadir}; \ |
---|
217 | done |
---|
218 | |
---|
219 | installinfo: |
---|
220 | cd ${docdir}; ${MAKE} install |
---|
221 | |
---|
222 | uninstall: uninstallbin uninstalldata uninstallinfo |
---|
223 | |
---|
224 | uninstallbin: |
---|
225 | -rm -f ${bindir}/Singular |
---|
226 | -rmdir ${bindir} |
---|
227 | |
---|
228 | uninstalldata: |
---|
229 | -rm -rf ${singulardatadir}/*.lib ${singulardatadir}/gftables |
---|
230 | -rmdir ${singulardatadir} |
---|
231 | |
---|
232 | unistallinfo: |
---|
233 | cd ${docdir}; ${MAKE} uninstall |
---|
234 | |
---|
235 | ## |
---|
236 | ## clean targest |
---|
237 | ## |
---|
238 | mostlyclean: clean |
---|
239 | |
---|
240 | clean: |
---|
241 | -rm -rf Singular* *.o *.og core *.d *.dd *~ \#* /tmp/mp* \ |
---|
242 | *.got *dump* *.diff |
---|
243 | cd ${docdir}; ${MAKE} clean |
---|
244 | |
---|
245 | distclean: clean |
---|
246 | -rm -rf depend *.inc ${DIST_NAME} ${testdir}/out stamp-h |
---|
247 | -rm mod2.h Makefile TAGS* config.status config.cache config.log |
---|
248 | cd ${docdir}; ${MAKE} clean |
---|
249 | |
---|
250 | maintainer-clean: distclean |
---|
251 | @echo "This command is intended for maintainers to use;" |
---|
252 | @echo "Rebuilding the deleted files requires flex (version 2.3) " |
---|
253 | @echo "bison and autoconf" |
---|
254 | -rm configure scanner.cc grammar.h grammar.cc |
---|
255 | |
---|
256 | info dvi ps html: |
---|
257 | cd ${docdir}; ${MAKE} $@ |
---|
258 | |
---|
259 | check: Singular ${testdir}/general_test.in ${testdir}/general_test.out |
---|
260 | - @ SINGULARPATH=`pwd`/LIB; export SINGULARPATH; \ |
---|
261 | PATH=`pwd`:${PATH}; export PATH;\ |
---|
262 | ${testdir}/comparecheck ${testdir}/general_test.in ${testdir}/general_test.out |
---|
263 | @ if test "${WITH_MP}" = yes; then ${MAKE} mpcheck; fi; |
---|
264 | @ if test "${WITH_FACTORY}" = yes && test "${WITH_LIBFAC}" = yes; then \ |
---|
265 | ${MAKE} factorycheck;\ |
---|
266 | fi |
---|
267 | |
---|
268 | |
---|
269 | mpcheck: Singular ${testdir}/mpcheck ${testdir}/mpcheck.data |
---|
270 | - @ SINGULARPATH=`pwd`/LIB; export SINGULARPATH; \ |
---|
271 | PATH=`pwd`:${PATH}; export PATH;\ |
---|
272 | ${testdir}/mpcheck ${testdir}/mpcheck.data |
---|
273 | |
---|
274 | factorycheck: Singular ${testdir}/comparecheck ${testdir}/fac_test.in \ |
---|
275 | ${testdir}/fac_test.out |
---|
276 | - @ SINGULARPATH=`pwd`/LIB; export SINGULARPATH; \ |
---|
277 | PATH=`pwd`:${PATH}; export PATH;\ |
---|
278 | ${testdir}/comparecheck ${testdir}/fac_test.in ${testdir}/fac_test.out |
---|
279 | |
---|
280 | ## |
---|
281 | ## miscellanous targets |
---|
282 | ## |
---|
283 | |
---|
284 | dist: |
---|
285 | -rm -rf ${DIST_NAME} |
---|
286 | -rm -f ${DIST_NAME}.tar.gz |
---|
287 | ${MKINSTALLDIRS} ${DIST_NAME}/LIB/gftables |
---|
288 | -ln ${DISTFILES} ${DIST_NAME} |
---|
289 | -ln LIB/*.lib ${DIST_NAME}/LIB |
---|
290 | -ln LIB/gftables/* ${DIST_NAME}/LIB/gftables |
---|
291 | tar cvf ${DIST_NAME}.tar ${DIST_NAME} |
---|
292 | gzip -9 ${DIST_NAME}.tar |
---|
293 | |
---|
294 | TAGS: |
---|
295 | etags ${SOURCES} ${HEADERS} |
---|
296 | |
---|
297 | ## |
---|
298 | ## Below here is stuff for developpers |
---|
299 | ################################################################# |
---|
300 | |
---|
301 | ## |
---|
302 | ## compiler and linker options for debug version |
---|
303 | ## |
---|
304 | |
---|
305 | CCG = gcc |
---|
306 | CXXG = gcc |
---|
307 | CXXM = gcc -MM |
---|
308 | CCM = gcc -MM |
---|
309 | |
---|
310 | CFLAGSG = -g -Wall -Wno-unused |
---|
311 | CXXFLAGSG = -g -Wall -Wno-unused |
---|
312 | CXXTEMPLFLAGSG = -fno-implicit-templates |
---|
313 | DEFSG = @DEFS@ |
---|
314 | |
---|
315 | ## |
---|
316 | ## .og files for having -O and -g object versions available at the same time |
---|
317 | ## |
---|
318 | |
---|
319 | OBJG1= grammar.og scanner.og matpol.og binom.og\ |
---|
320 | febase.og feread.og timer.og intvec.og attrib.og lists.og\ |
---|
321 | longrat.og longrat0.og misc.og ring.og numbers.og maps.og\ |
---|
322 | hilb.og kstd1.og kstd2.og kutil.og khstd.og kstdfac.og modulop.og \ |
---|
323 | spolys.og ideals.og subexpr.og hdegree.og hutil.og ffields.og shortfl.og \ |
---|
324 | longalg.og spolys0.og syz.og syz0.og syz1.og weight.og \ |
---|
325 | ipid.og ipshell.og iplib.og ipassign.og ipconv.og ipprint.og\ |
---|
326 | polys.og polys0.og polys1.og polys2.og extra.og\ |
---|
327 | mminit.og sing_dld.og sing_dbm.og silink.og \ |
---|
328 | sing_mp.og fglm.og fglmzero.og fglmvec.og \ |
---|
329 | algmap.og clapconv.og clapmem.og clapsing.og \ |
---|
330 | cntrlc.og \ |
---|
331 | mpsr_Error.og mpsr_Put.og mpsr_PutPoly.og mpsr_GetPoly.og \ |
---|
332 | mpsr_Get.og mpsr_GetMisc.og |
---|
333 | |
---|
334 | OBJG2= mmalloc.og mmallocb.og mmallocs.og mmblock.og mmheap.og \ |
---|
335 | mmspec.og mmutil.og |
---|
336 | |
---|
337 | OBJG=$(OBJG1) $(OBJG2) claptmpl.og |
---|
338 | |
---|
339 | ## |
---|
340 | ## Debug Targets |
---|
341 | ## |
---|
342 | |
---|
343 | claptmpl.og: claptmpl.cc mod2.h |
---|
344 | $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@ |
---|
345 | $(OBJG1): %.og: %.cc |
---|
346 | $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@ |
---|
347 | |
---|
348 | $(OBJG2): %.og: %.c |
---|
349 | $(CCG) ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@ |
---|
350 | |
---|
351 | Singularg: scanner.cc $(OBJG) iparith.og mpsr_Tok.og tesths.cc version.h |
---|
352 | $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -o Singularg \ |
---|
353 | tesths.cc iparith.og mpsr_Tok.og $(OBJG) ${LDFLAGS} ${LIBS} |
---|
354 | |
---|
355 | iparith.og: ${OBJS} iparith.inc iparith.cc |
---|
356 | $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c iparith.cc -o iparith.og |
---|
357 | |
---|
358 | mpsr_Tok.og: iparith.inc mpsr_Tok.cc |
---|
359 | $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c mpsr_Tok.cc -o mpsr_Tok.og |
---|
360 | |
---|
361 | installg: Singularg |
---|
362 | ${MKINSTALLDIRS} ${bindir} |
---|
363 | ${INSTALL_PROGRAM} Singularg ${bindir} |
---|
364 | |
---|
365 | |
---|
366 | ## |
---|
367 | ## dependencies |
---|
368 | ## |
---|
369 | |
---|
370 | %.dd: %.cc mod2.h |
---|
371 | echo $@ $(@:.dd=.og) " " \\ > $@ |
---|
372 | $(CXXM) -DGENTABLE ${CPPFLAGS} ${DEFSG} $< >> $@ |
---|
373 | |
---|
374 | %.d: %.c mod2.h |
---|
375 | echo $@ $(@:.d=.og) " " \\ > $@ |
---|
376 | $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@ |
---|
377 | |
---|
378 | depend: $(CXXSOURCES:.cc=.dd) $(CSOURCES:.c=.d) mod2.h |
---|
379 | cat *.d *.dd >depend |
---|
380 | |
---|
381 | #include $(SOURCES:.cc=.dd) $(CSOURCES:.c=.d) |
---|
382 | #include *.d *.dd |
---|
383 | ifeq (depend,$(wildcard depend)) |
---|
384 | include depend |
---|
385 | endif |
---|
386 | |
---|
387 | |
---|