1 | ################################################################# |
---|
2 | ### |
---|
3 | ### Makefile for Singular |
---|
4 | ### |
---|
5 | ################################################################# |
---|
6 | |
---|
7 | SHELL = /bin/sh |
---|
8 | |
---|
9 | ## |
---|
10 | ## versions |
---|
11 | ## |
---|
12 | MAJOR_VERSION = @MAJOR_VERSION@ |
---|
13 | MINOR_VERSION = @MINOR_VERSION@ |
---|
14 | DIST_NAME = Singular-${MAJOR_VERSION}.${MINOR_VERSION} |
---|
15 | CONFIGURE_INPUT = @ac_configure_args@ |
---|
16 | |
---|
17 | ## |
---|
18 | ## various paths |
---|
19 | ## |
---|
20 | srcdir = @srcdir@ |
---|
21 | prefix = @prefix@ |
---|
22 | exec_prefix = @exec_prefix@ |
---|
23 | libdir = @libdir@ |
---|
24 | # program executable goes here |
---|
25 | bindir = @bindir@ |
---|
26 | # read-only architecture-independent data (like Singular libs) go here |
---|
27 | singulardatadir = @singulardatadir@ |
---|
28 | includedir = @includedir@ |
---|
29 | |
---|
30 | ## |
---|
31 | ## various programs |
---|
32 | ## |
---|
33 | CC = @CC@ |
---|
34 | CXX = @CXX@ |
---|
35 | BISON = @BISON@ |
---|
36 | LEX = @LEX@ |
---|
37 | INSTALL = @INSTALL@ |
---|
38 | INSTALL_DATA = @INSTALL_DATA@ |
---|
39 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
---|
40 | MKINSTALLDIRS = @MKINSTALLDIRS@ |
---|
41 | |
---|
42 | ## |
---|
43 | ## compiler and linker options |
---|
44 | ## |
---|
45 | CFLAGS = @CFLAGS@ |
---|
46 | CXXFLAGS = @CXXFLAGS@ |
---|
47 | CXXTEMPLFLAGS = @CXXTEMPLFLAGS@ |
---|
48 | CPPFLAGS = @CPPFLAGS@ -I${srcdir} |
---|
49 | DEFS = @DEFS@ -DNDEBUG |
---|
50 | LDFLAGS = @LDFLAGS@ |
---|
51 | LIBS = @LIBS@ |
---|
52 | |
---|
53 | ## |
---|
54 | ## End configuration dependend stuff |
---|
55 | ################################################################# |
---|
56 | |
---|
57 | CXXSOURCES=grammar.cc scanner.cc algmap.cc attrib.cc binom.cc clapconv.cc \ |
---|
58 | clapmem.cc clapsing.cc claptmpl.cc cntrlc.cc \ |
---|
59 | extra.cc febase.cc feread.cc \ |
---|
60 | ffields.cc hdegree.cc hilb.cc hutil.cc \ |
---|
61 | ideals.cc intvec.cc iparith.cc \ |
---|
62 | ipassign.cc ipconv.cc ipid.cc iplib.cc \ |
---|
63 | ipprint.cc ipshell.cc khstd.cc kstdfac.cc \ |
---|
64 | kstd1.cc kstd2.cc kutil.cc lists.cc \ |
---|
65 | longalg.cc longrat.cc \ |
---|
66 | longrat0.cc maps.cc matpol.cc misc.cc \ |
---|
67 | mminit.cc modulop.cc \ |
---|
68 | fglm.cc fglmzero.cc fglmvec.cc \ |
---|
69 | numbers.cc polys.cc polys0.cc polys1.cc polys2.cc \ |
---|
70 | ring.cc shortfl.cc silink.cc sing_mp.cc\ |
---|
71 | sing_dld.cc sing_dbm.cc spolys.cc spolys0.cc \ |
---|
72 | subexpr.cc syz.cc syz0.cc syz1.cc \ |
---|
73 | tesths.cc timer.cc weight.cc \ |
---|
74 | mpsr_Put.cc mpsr_PutPoly.cc mpsr_Tok.cc mpsr_GetPoly.cc \ |
---|
75 | mpsr_Get.cc mpsr_GetMisc.cc mpsr_Error.cc |
---|
76 | |
---|
77 | CSOURCES=mmalloc.c mmallocb.c mmallocs.c mmblock.c mmheap.c mmspec.c mmutil.c |
---|
78 | |
---|
79 | SOURCES=${CSOURCES} ${CXXSOURCES} grammar.y scanner.l |
---|
80 | |
---|
81 | HEADERS=algmap.h hutil.h lists.h stairc.h attrib.h ideals.h \ |
---|
82 | longalg.h mpsr_Tok.h structs.h binom.h intvec.h longrat.h \ |
---|
83 | numbers.h stype.h clapconv.h ipconv.h maps.h page.h \ |
---|
84 | subexpr.h clapsing.h ipid.h matpol.h polys.h syz.h \ |
---|
85 | cntrlc.h ipprint.h mmemory.h ring.h timer.h \ |
---|
86 | febase.h ipshell.h mmprivat.h shortfl.h tok.h \ |
---|
87 | ffields.h khstd.h silink.h \ |
---|
88 | fglm.h kstd1.h modulop.h sing_dbm.h weight.h \ |
---|
89 | fglmvec.h kstd2.h mpsr.h sing_mp.h \ |
---|
90 | kstdfac.h mpsr_Get.h spolys.h \ |
---|
91 | kutil.h mpsr_Put.h spolys0.h |
---|
92 | |
---|
93 | DISTFILES=${SOURCES} ${HEADERS} Makefile.in configure.in configure \ |
---|
94 | mod2.h.in grammar.h testgh install-sh mkinstalldirs |
---|
95 | |
---|
96 | OBJS=grammar.o scanner.o matpol.o binom.o\ |
---|
97 | febase.o feread.o timer.o intvec.o attrib.o lists.o\ |
---|
98 | longrat.o longrat0.o misc.o ring.o numbers.o maps.o\ |
---|
99 | hilb.o kstd1.o kstd2.o kutil.o khstd.o kstdfac.o modulop.o spolys.o\ |
---|
100 | ideals.o subexpr.o hdegree.o hutil.o ffields.o shortfl.o \ |
---|
101 | longalg.o spolys0.o syz.o syz0.o syz1.o weight.o \ |
---|
102 | ipid.o ipshell.o iplib.o ipassign.o ipconv.o ipprint.o\ |
---|
103 | polys.o polys0.o polys1.o polys2.o extra.o\ |
---|
104 | mminit.o mmutil.o mmalloc.o mmallocb.o mmallocs.o \ |
---|
105 | mmspec.o mmblock.o mmheap.o sing_dld.o sing_dbm.o silink.o \ |
---|
106 | sing_mp.o fglm.o fglmzero.o fglmvec.o cntrlc.o \ |
---|
107 | algmap.o clapconv.o clapmem.o clapsing.o claptmpl.o\ |
---|
108 | mpsr_Error.o mpsr_Put.o mpsr_PutPoly.o mpsr_GetPoly.o \ |
---|
109 | mpsr_Get.o mpsr_GetMisc.o |
---|
110 | |
---|
111 | ## |
---|
112 | ## PRIMARY Targets |
---|
113 | ## |
---|
114 | |
---|
115 | .l.cc: |
---|
116 | ${LEX} -s -I -t $< > scanner.cc |
---|
117 | |
---|
118 | .y.cc: |
---|
119 | ${BISON} -d -t -o grammar.cc $< |
---|
120 | chmod +x testgh |
---|
121 | ./testgh |
---|
122 | |
---|
123 | .cc.o: |
---|
124 | ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} -c $< |
---|
125 | .c.o: |
---|
126 | ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $< |
---|
127 | |
---|
128 | Singular: mod2.h version.h scanner.cc ${OBJS} iparith.o mpsr_Tok.o tesths.cc |
---|
129 | ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -o Singular \ |
---|
130 | tesths.cc iparith.o mpsr_Tok.o ${OBJS} ${LDFLAGS} ${LIBS} |
---|
131 | |
---|
132 | iparith.o mpsr_Tok.o : iparith.inc |
---|
133 | |
---|
134 | claptmpl.o: claptmpl.cc mod2.h |
---|
135 | ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -c $< |
---|
136 | |
---|
137 | |
---|
138 | iparith.inc : ${OBJS} iparith.cc ipconv.cc tok.h mpsr_Tok.cc grammar.h |
---|
139 | ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -DGENTABLE -o gentable \ |
---|
140 | iparith.cc tesths.cc mpsr_Tok.cc ${OBJS} ${LDFLAGS} ${LIBS} |
---|
141 | ./gentable |
---|
142 | /bin/rm gentable |
---|
143 | |
---|
144 | version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in configure.in |
---|
145 | echo "#define VERSION_ID " `date '+%y%m%d%H'` >version.h |
---|
146 | |
---|
147 | mod2.h: configure mod2.h.in Makefile.in |
---|
148 | ./configure ${CONFIGURE_INPUT} |
---|
149 | touch -r mod2.h configure configure.in Makefile.in |
---|
150 | |
---|
151 | configure: configure.in |
---|
152 | autoconf configure.in > configure |
---|
153 | chmod a+x configure |
---|
154 | |
---|
155 | all: Singular |
---|
156 | |
---|
157 | install: all installbin installdata |
---|
158 | |
---|
159 | installbin: Singular |
---|
160 | ${MKINSTALLDIRS} ${bindir} |
---|
161 | ${INSTALL_PROGRAM} Singular ${bindir} |
---|
162 | |
---|
163 | installdata: |
---|
164 | ${MKINSTALLDIRS} ${singulardatadir} |
---|
165 | ${MKINSTALLDIRS} ${singulardatadir}/gftables |
---|
166 | for file in ${srcdir}/LIB/gftables/[0-9]*; do \ |
---|
167 | ${INSTALL_DATA} $${file} ${singulardatadir}/gftables; \ |
---|
168 | done |
---|
169 | for file in ${srcdir}/LIB/*.lib; do \ |
---|
170 | ${INSTALL_DATA} $${file} ${singulardatadir}; \ |
---|
171 | done |
---|
172 | |
---|
173 | uninstall: uninstallbin uninstalldata |
---|
174 | |
---|
175 | uninstallin: |
---|
176 | -rm -f ${bindir}/Singular |
---|
177 | -rmdir ${bindir} |
---|
178 | |
---|
179 | uninstalldata: |
---|
180 | -rm -rf ${singulardatadir}/*.lib ${singulardatadir}/gftables |
---|
181 | -rmdir ${singulardatadir} |
---|
182 | |
---|
183 | mostlyclean: clean |
---|
184 | |
---|
185 | clean: |
---|
186 | -rm -f Singular* *.o *.og core *.d *.dd *~\#* |
---|
187 | |
---|
188 | distclean: clean |
---|
189 | -rm -f depend *.inc ${DIST_NAME} |
---|
190 | -rm mod2.h Makefile TAGS* config.status config.cache config.log |
---|
191 | |
---|
192 | maintainer-clean: distlean |
---|
193 | @echo "This command is intended for maintainers to use;" |
---|
194 | @echo "it deletes files that may require special tools to rebuild." |
---|
195 | -rm configure scanner.cc grammar.h grammar.cc |
---|
196 | |
---|
197 | check: Makefile.in tests/check tests/output |
---|
198 | cd tests; tests/check ${bindir}/Singular; cd .. |
---|
199 | |
---|
200 | dist: |
---|
201 | -rm -rf ${DIST_NAME} |
---|
202 | -rm -f ${DIST_NAME}.tar.gz |
---|
203 | ${MKINSTALLDIRS} ${DIST_NAME}/LIB/gftables |
---|
204 | -ln ${DISTFILES} ${DIST_NAME} |
---|
205 | -ln LIB/*.lib ${DIST_NAME}/LIB |
---|
206 | -ln LIB/gftables/* ${DIST_NAME}/LIB/gftables |
---|
207 | tar cvf ${DIST_NAME}.tar ${DIST_NAME} |
---|
208 | gzip -9 ${DIST_NAME}.tar |
---|
209 | |
---|
210 | TAGS: |
---|
211 | etags ${SOURCES} ${HEADERS} |
---|
212 | |
---|
213 | ## |
---|
214 | ## Below here is stuff for developpers |
---|
215 | ################################################################# |
---|
216 | |
---|
217 | ## |
---|
218 | ## compiler and linker options |
---|
219 | ## |
---|
220 | |
---|
221 | CCG = gcc |
---|
222 | CXXG = gcc |
---|
223 | CXXM = gcc -MM |
---|
224 | CCM = gcc -MM |
---|
225 | |
---|
226 | CFLAGSG = -g -Wall -Wno-unused |
---|
227 | CXXFLAGSG = -g -Wall -Wno-unused |
---|
228 | CXXTEMPLFLAGSG = -fno-implicit-templates |
---|
229 | DEFSG = @DEFS@ |
---|
230 | |
---|
231 | ## |
---|
232 | ## .og files for having -O and -g object versions available at the same time |
---|
233 | ## |
---|
234 | |
---|
235 | OBJG1= grammar.og scanner.og matpol.og binom.og\ |
---|
236 | febase.og feread.og timer.og intvec.og attrib.og lists.og\ |
---|
237 | longrat.og longrat0.og misc.og ring.og numbers.og maps.og\ |
---|
238 | hilb.og kstd1.og kstd2.og kutil.og khstd.og kstdfac.og modulop.og \ |
---|
239 | spolys.og ideals.og subexpr.og hdegree.og hutil.og ffields.og shortfl.og \ |
---|
240 | longalg.og spolys0.og syz.og syz0.og syz1.og weight.og \ |
---|
241 | ipid.og ipshell.og iplib.og ipassign.og ipconv.og ipprint.og\ |
---|
242 | polys.og polys0.og polys1.og polys2.og extra.og\ |
---|
243 | mminit.og sing_dld.og sing_dbm.og silink.og \ |
---|
244 | sing_mp.og fglm.og fglmzero.og fglmvec.og \ |
---|
245 | algmap.og clapconv.og clapmem.og clapsing.og \ |
---|
246 | cntrlc.og \ |
---|
247 | mpsr_Error.og mpsr_Put.og mpsr_PutPoly.og mpsr_GetPoly.og \ |
---|
248 | mpsr_Get.og mpsr_GetMisc.og |
---|
249 | |
---|
250 | OBJG2= mmalloc.og mmallocb.og mmallocs.og mmblock.og mmheap.og \ |
---|
251 | mmspec.og mmutil.og |
---|
252 | |
---|
253 | OBJG=$(OBJG1) $(OBJG2) claptmpl.og |
---|
254 | |
---|
255 | ## |
---|
256 | ## Targets |
---|
257 | ## |
---|
258 | |
---|
259 | claptmpl.og: claptmpl.cc mod2.h |
---|
260 | $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@ |
---|
261 | $(OBJG1): %.og: %.cc |
---|
262 | $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@ |
---|
263 | |
---|
264 | $(OBJG2): %.og: %.c |
---|
265 | $(CCG) ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@ |
---|
266 | |
---|
267 | Singularg: scanner.cc $(OBJG) iparith.og mpsr_Tok.og tesths.cc version.h |
---|
268 | $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -o Singularg \ |
---|
269 | tesths.cc iparith.og mpsr_Tok.og $(OBJG) ${LDFLAGS} ${LIBS} |
---|
270 | |
---|
271 | iparith.og: iparith.inc iparith.cc |
---|
272 | $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c iparith.cc -o iparith.og |
---|
273 | |
---|
274 | mpsr_Tok.og: iparith.inc mpsr_Tok.cc |
---|
275 | $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c mpsr_Tok.cc -o mpsr_Tok.og |
---|
276 | |
---|
277 | installg: Singularg |
---|
278 | ${MKINSTALLDIRS} ${bindir} |
---|
279 | ${INSTALL_PROGRAM} Singularg ${bindir} |
---|
280 | |
---|
281 | |
---|
282 | ## |
---|
283 | ## dependencies |
---|
284 | ## |
---|
285 | |
---|
286 | %.dd: %.cc mod2.h |
---|
287 | echo $@ $(@:.dd=.og) " " \\ > $@ |
---|
288 | $(CXXM) -DGENTABLE ${CPPFLAGS} ${DEFSG} $< >> $@ |
---|
289 | |
---|
290 | %.d: %.c mod2.h |
---|
291 | echo $@ $(@:.d=.og) " " \\ > $@ |
---|
292 | $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@ |
---|
293 | |
---|
294 | depend: $(CXXSOURCES:.cc=.dd) $(CSOURCES:.c=.d) mod2.h |
---|
295 | cat *.d *.dd >depend |
---|
296 | |
---|
297 | #include $(SOURCES:.cc=.dd) $(CSOURCES:.c=.d) |
---|
298 | #include *.d *.dd |
---|
299 | ifeq (depend,$(wildcard depend)) |
---|
300 | include depend |
---|
301 | endif |
---|
302 | |
---|
303 | |
---|