1 | ################################################################ |
---|
2 | ### |
---|
3 | ### Makefile for Singular |
---|
4 | ### |
---|
5 | ################################################################# |
---|
6 | |
---|
7 | SHELL = /bin/sh |
---|
8 | |
---|
9 | ## |
---|
10 | ## version |
---|
11 | ## |
---|
12 | SINGULAR_VERSION = @SINGULAR_VERSION@ |
---|
13 | SINGULAR = @SINGULAR@ |
---|
14 | SINGUNAME = @SINGUNAME@ |
---|
15 | EXEC_EXT = @EXEC_EXT@ |
---|
16 | HAVE_PLURAL = @PLURAL@ |
---|
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 | # includes are taken from here |
---|
27 | includedir = @includedir@ |
---|
28 | slibdir = ${prefix}/LIB |
---|
29 | install_bindir = ${install_prefix}/${SINGUNAME} |
---|
30 | install_slibdir = ${install_prefix}/LIB |
---|
31 | |
---|
32 | ## |
---|
33 | ## various programs |
---|
34 | ## |
---|
35 | @SET_MAKE@ |
---|
36 | CC = @CC@ |
---|
37 | LD = @LD@ |
---|
38 | CXX = @CXX@ |
---|
39 | LEX = sh flexer.sh |
---|
40 | |
---|
41 | PERL = @PERL@ |
---|
42 | BISON = bison |
---|
43 | INSTALL = @INSTALL@ |
---|
44 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
---|
45 | INSTALL_DATA = @INSTALL_DATA@ |
---|
46 | MKINSTALLDIRS = ./mkinstalldirs |
---|
47 | LN_S = @LN_S@ |
---|
48 | |
---|
49 | ## |
---|
50 | ## compiler and linker options |
---|
51 | ## |
---|
52 | PIPE = @PIPE@ |
---|
53 | CFLAGS = @CFLAGS@ ${PIPE} |
---|
54 | CXXFLAGS = @CXXFLAGS@ ${PIPE} |
---|
55 | CXXTEMPLFLAGS = @CXXTEMPLFLAGS@ |
---|
56 | ifneq ($(SINGUNAME),ix86-Win) |
---|
57 | CPPFLAGS = -I${srcdir} -I../kernel @CPPFLAGS@ |
---|
58 | else |
---|
59 | ## Dirs after @CPPFLAGS@ are for PySingular |
---|
60 | CPPFLAGS = -I${srcdir} -I../kernel @CPPFLAGS@ |
---|
61 | ## -I/usr/include/python2.4 -I/usr/local/include -I../modules/python |
---|
62 | endif |
---|
63 | DEFS = -DNDEBUG -DOM_NDEBUG -D@SING_UNAME@ @DEFS@ |
---|
64 | LDFLAGS2 = @LDFLAGS@ |
---|
65 | ifneq ($(SINGUNAME),ix86-Win) |
---|
66 | LDFLAGS = -L../kernel -lkernel @LDFLAGS@ |
---|
67 | LDFLAGSG = -L../kernel -lkernel_g @LDFLAGS@ |
---|
68 | LDFLAGSP = -L../kernel -lkernel_p @LDFLAGS@ |
---|
69 | else |
---|
70 | ## -L/usr/local/lib -L../modules/python --> PySingular |
---|
71 | LDFLAGS = -L../kernel -L/bin -lkernel @LDFLAGS@ -L/usr/local/lib -L../modules/python |
---|
72 | LDFLAGSG = -L../kernel -L/bin -lkernel_g @LDFLAGS@ |
---|
73 | LDFLAGSP = -L../kernel -L/bin -lkernel_p @LDFLAGS@ |
---|
74 | endif |
---|
75 | LD_DYN_FLAGS = @LD_DYN_FLAGS@ |
---|
76 | SFLAGS = @SFLAGS@ |
---|
77 | SLDFLAGS = @SLDFLAGS@ |
---|
78 | |
---|
79 | ## For PYSingular |
---|
80 | ifneq ($(SINGUNAME),ix86-Win) |
---|
81 | WIN_LIBS = |
---|
82 | else |
---|
83 | WIN_LIBS = |
---|
84 | ##../modules/python/libpython_module.a |
---|
85 | endif |
---|
86 | |
---|
87 | LD_LIBC = -lc |
---|
88 | STATIC_LDFLAGS = @STATIC_LDFLAGS@ |
---|
89 | # under cygwin, do not explicitly link against -lm, for it is the cygwin |
---|
90 | # lib -- if you really want to do this, use -lm as the _last_ thing on the |
---|
91 | # arguments to link |
---|
92 | ifneq ($(SINGUNAME),ix86-Win) |
---|
93 | LIBS = -lm @NEED_LIBS@ |
---|
94 | LIBSG = -lm @NEED_LIBSG@ |
---|
95 | LIBSP = -lm @NEED_LIBSG@ |
---|
96 | else |
---|
97 | LIBS = -lsingfac -lsingcf -lntl -static -lreadline -lhtmlhelp -Xlinker -Bdynamic -lgmp -lomalloc_ndebug -lncurses |
---|
98 | ## -lpython_module -lpython2.4 /usr/local/lib/libboost_python-gcc-d-1_32.dll |
---|
99 | LIBSG = -lsingfac -lsingcf -lntl -static -lreadline -lhtmlhelp -Xlinker -Bdynamic -lgmp -lncurses |
---|
100 | endif |
---|
101 | MP_LIBS = @MP_LIBS@ |
---|
102 | HAVE_MPSR = @HAVE_MPSR@ |
---|
103 | |
---|
104 | # |
---|
105 | # Handle libSINGULAR stuff |
---|
106 | # |
---|
107 | LIBSINGULAR_LIBS =-lsingfac -lsingcf -lntl -lreadline -lgmp -lomalloc |
---|
108 | |
---|
109 | SO_SUFFIX = so |
---|
110 | #LIBSINGULAR_FLAGS = -export-dynamic |
---|
111 | LIBSINGULAR_LD = $(CXX) |
---|
112 | |
---|
113 | # correct suffix for dynamic linking |
---|
114 | ifeq ($(SINGUNAME),ix86Mac-darwin) |
---|
115 | SO_SUFFIX = dylib |
---|
116 | LIBSINGULAR_FLAGS = -single_module |
---|
117 | LIBSINGULAR_LD = $(LD) |
---|
118 | endif |
---|
119 | |
---|
120 | ifeq ($(SINGUNAME),ppcMac-darwin) |
---|
121 | MACOSX_DEPLOYMENT_TARGET=10.4 |
---|
122 | SO_SUFFIX = dylib |
---|
123 | LIBSINGULAR_FLAGS = -single_module |
---|
124 | LIBSINGULAR_LD = $(LD) |
---|
125 | endif |
---|
126 | |
---|
127 | ifeq ($(SINGUNAME),ix86-Win) |
---|
128 | SO_SUFFIX = dll |
---|
129 | LIBSINGULAR_FLAGS = -shared |
---|
130 | LIBSINGULAR_LIBS = -lsingfac -lsingcf -lntl -lreadline -lgmp -lomalloc -lhtmlhelp |
---|
131 | endif |
---|
132 | |
---|
133 | # |
---|
134 | # End libSINGULAR |
---|
135 | # |
---|
136 | |
---|
137 | ifdef LD_STATIC |
---|
138 | LDFLAGS := ${STATIC_LDFLAGS} ${LDFLAGS} |
---|
139 | SING_EXEC = Singular-static |
---|
140 | LIBS := ${MP_LIBS} ${LIBS} |
---|
141 | LIBSG := ${MP_LIBS} ${LIBSG} |
---|
142 | DL_KERNEL = |
---|
143 | GLIBC_DYN_FIX= |
---|
144 | else |
---|
145 | LDFLAGS := ${LD_DYN_FLAGS} ${LDFLAGS} |
---|
146 | SING_EXEC = Singular |
---|
147 | DL_KERNEL = @DL_KERNEL@ |
---|
148 | GLIBC_DYN_FIX= @GLIBC_DYN_FIX@ |
---|
149 | endif |
---|
150 | |
---|
151 | # CXXFLAGS = -g -Wall -Wno-unused |
---|
152 | # CFLAGS = -g -Wall -Wno-unused |
---|
153 | ## |
---|
154 | ## End configuration dependend stuff |
---|
155 | ################################################################# |
---|
156 | |
---|
157 | ### |
---|
158 | ### file sets |
---|
159 | ### |
---|
160 | |
---|
161 | # normal C++ source files |
---|
162 | CXXSOURCES=grammar.cc scanner.cc attrib.cc \ |
---|
163 | eigenval_ip.cc\ |
---|
164 | extra.cc fehelp.cc feOpt.cc \ |
---|
165 | ipassign.cc ipconv.cc ipid.cc iplib.cc \ |
---|
166 | ipprint.cc ipshell.cc \ |
---|
167 | lists.cc \ |
---|
168 | sdb.cc \ |
---|
169 | fglm.cc interpolation.cc\ |
---|
170 | silink.cc \ |
---|
171 | subexpr.cc \ |
---|
172 | janet.cc wrapper.cc\ |
---|
173 | libparse.cc sing_win.cc\ |
---|
174 | gms.cc pcv.cc maps_ip.cc\ |
---|
175 | walk.cc walk_ip.cc \ |
---|
176 | cntrlc.cc misc_ip.cc \ |
---|
177 | calcSVD.cc \ |
---|
178 | Minor.cc \ |
---|
179 | MinorProcessor.cc \ |
---|
180 | MinorInterface.cc |
---|
181 | |
---|
182 | # stuff for MP |
---|
183 | MPSR_SOURCES = mpsr_Put.cc mpsr_PutPoly.cc mpsr_GetPoly.cc mpsr_sl.cc\ |
---|
184 | mpsr_Get.cc mpsr_GetMisc.cc mpsr_Error.cc \ |
---|
185 | |
---|
186 | |
---|
187 | # stuff for dbm |
---|
188 | DBMSR_SOURCES = ndbm.cc sing_dbm.cc |
---|
189 | |
---|
190 | # normal C source files |
---|
191 | CSOURCES= |
---|
192 | |
---|
193 | # C++ sources which are used if part of the kernel are dynamically linked |
---|
194 | DL_KERNEL_SOURCES=slInit_Dynamic.cc |
---|
195 | |
---|
196 | # C++ sources which are used for dynamic libraries if part of the kernel is |
---|
197 | # dynamically linked |
---|
198 | DL_LIB_SOURCES= |
---|
199 | |
---|
200 | # C++ sources which are used if no parts of the kernel are dynamically linked |
---|
201 | STATIC_SOURCES=slInit_Static.cc |
---|
202 | |
---|
203 | # C++ sources for which both, shared and static object files are needed |
---|
204 | COMMON_SOURCES = $(MPSR_SOURCES) $(DBMSR_SOURCES) |
---|
205 | |
---|
206 | # special C++ source files (need extra compiling and/or linking), for which |
---|
207 | # dependencies should be generated |
---|
208 | ESOURCES=iparith.cc $(COMMON_SOURCES) \ |
---|
209 | $(DL_KERNEL_SOURCES) $(DL_LIB_SOURCES) $(STATIC_SOURCES) |
---|
210 | |
---|
211 | SOURCES=${CSOURCES} ${CXXSOURCES} \ |
---|
212 | grammar.y scanner.l libparse.l \ |
---|
213 | utils.cc utils.h \ |
---|
214 | tesths.cc mpsr_Tok.cc claptmpl.cc |
---|
215 | |
---|
216 | HEADERS=lists.h attrib.h \ |
---|
217 | mpsr_Tok.h \ |
---|
218 | ipconv.h \ |
---|
219 | subexpr.h ipid.h \ |
---|
220 | cntrlc.h ipprint.h sdb.h \ |
---|
221 | ipshell.h tok.h \ |
---|
222 | silink.h \ |
---|
223 | sing_dbm.h maps_ip.h interpolation.h \ |
---|
224 | mpsr.h mpsr_sl.h\ |
---|
225 | mpsr_Get.h janet.h\ |
---|
226 | mpsr_Put.h walk.h\ |
---|
227 | dbm_sl.h libparse.h \ |
---|
228 | gms.h pcv.h eigenval_ip.h \ |
---|
229 | distrib.h walk.h \ |
---|
230 | static.h \ |
---|
231 | omSingularConfig.h |
---|
232 | |
---|
233 | DISTFILES=${SOURCES} ${HEADERS} ${ESOURCES} \ |
---|
234 | Makefile.in configure.in configure \ |
---|
235 | mod2.h.in grammar.h testgh install-sh mkinstalldirs \ |
---|
236 | check_aso.pl |
---|
237 | |
---|
238 | OBJS := $(CXXSOURCES:.cc=.o) $(CSOURCES:.c=.o) |
---|
239 | |
---|
240 | ifeq ($(SINGUNAME),ix86-Win) |
---|
241 | OBJS := $(OBJS) Singular_res.o |
---|
242 | endif |
---|
243 | |
---|
244 | P_PROCS_MODULES = FieldZp FieldIndep FieldQ FieldGeneral |
---|
245 | |
---|
246 | ifeq ($(DL_KERNEL),1) |
---|
247 | OBJS := $(OBJS) $(DL_KERNEL_SOURCES:.cc=.o) |
---|
248 | DBMSR_SO= dbmsr.so |
---|
249 | DL_LIBS := $(DBMSR_SO) |
---|
250 | ifeq ($(HAVE_MPSR), 1) |
---|
251 | MPSR_SO = mpsr.so |
---|
252 | DL_LIBS := $(DL_LIBS) $(MPSR_SO) |
---|
253 | endif |
---|
254 | else |
---|
255 | ifndef LD_STATIC |
---|
256 | ifeq ($(HAVE_MPSR), 1) |
---|
257 | LIBS := $(MP_LIBS) $(LIBS) |
---|
258 | LIBSG := $(MP_LIBS) $(LIBSG) |
---|
259 | endif |
---|
260 | endif |
---|
261 | OBJS := $(OBJS) $(STATIC_SOURCES:.cc=.o) $(COMMON_SOURCES:.cc=.o) |
---|
262 | OBJSG := $(OBJSG) $(STATIC_SOURCES:.cc=.og) $(COMMON_SOURCES:.cc=.og) |
---|
263 | DL_LIBS= |
---|
264 | endif |
---|
265 | |
---|
266 | |
---|
267 | # |
---|
268 | # Singular libraries which go into distribution |
---|
269 | # MAKE SURE THAT THIS IS UP_TO_DATE |
---|
270 | # |
---|
271 | include singular-libs |
---|
272 | |
---|
273 | ifdef HAVE_PLURAL |
---|
274 | SLIBS = COPYING ${SLIB0} ${PLIBS} all.lib help.cnf |
---|
275 | else |
---|
276 | SLIBS = COPYING ${SLIB0} all.lib help.cnf |
---|
277 | endif |
---|
278 | |
---|
279 | SLIBS_FILES = $(addprefix LIB/,${SLIBS}) |
---|
280 | |
---|
281 | GFTABLES = $(wildcard LIB/gftables/[1-9]*) |
---|
282 | |
---|
283 | ## |
---|
284 | ## Build Targets |
---|
285 | ## |
---|
286 | .l.cc: |
---|
287 | @if test -r scanner.cc; then \ |
---|
288 | touch scanner.cc ;\ |
---|
289 | elif test "x${LEX}" = x; then \ |
---|
290 | echo Error: no lex given, could not rebuilt scanner.cc;\ |
---|
291 | exit 1; \ |
---|
292 | fi |
---|
293 | ${LEX} -s -I -t $< > scanner.cc.lmp |
---|
294 | cp scanner.cc.lmp scanner.cc |
---|
295 | |
---|
296 | .y.cc: |
---|
297 | @if test -r grammar.cc; then \ |
---|
298 | touch grammar.cc ;\ |
---|
299 | else \ |
---|
300 | if test "x${BISON}" = x; then \ |
---|
301 | echo Error: no bison given, could not rebuilt grammar.cc;\ |
---|
302 | exit 1; \ |
---|
303 | fi;\ |
---|
304 | ${BISON} -d -t -o grammar.cc $<;\ |
---|
305 | chmod +x testgh;\ |
---|
306 | ./testgh;\ |
---|
307 | fi |
---|
308 | |
---|
309 | .cc.o: |
---|
310 | ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} -c $< |
---|
311 | .c.o: |
---|
312 | ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $< |
---|
313 | |
---|
314 | %.dl_o : %.cc |
---|
315 | ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} ${SFLAGS} -c $< -o $@ |
---|
316 | |
---|
317 | all: $(SING_EXEC) |
---|
318 | |
---|
319 | Singular-static: version.h |
---|
320 | sleep 1 |
---|
321 | echo "#define HAVE_STATIC" > static.h |
---|
322 | (cd ../kernel;rm -f mod_raw.o;${MAKE} LD_STATIC=1 depend install-bindist;cd ../Singular) |
---|
323 | ${MAKE} LD_STATIC=1 S_EXT="-static" depend Singular-static |
---|
324 | echo "#undef HAVE_STATIC" > static.h |
---|
325 | |
---|
326 | Singular${S_EXT}: mod2.h Makefile version.h $(WIN_LIBS) scanner.cc ${OBJS} \ |
---|
327 | iparith.o tesths.cc libparse.cc claptmpl.o mpsr_Tok.o $(DL_LIBS) |
---|
328 | ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} \ |
---|
329 | -o Singular${S_EXT} \ |
---|
330 | tesths.cc iparith.o mpsr_Tok.o claptmpl.o\ |
---|
331 | ${OBJS} ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o |
---|
332 | |
---|
333 | libsingular: mod2.h Makefile version.h $(WIN_LIBS) scanner.cc ${OBJS} \ |
---|
334 | iparith.o libsingular-tesths.o libparse.cc claptmpl.o mpsr_Tok.o $(DL_LIBS) |
---|
335 | $(LIBSINGULAR_LD) ${SLDFLAGS} ${LIBSINGULAR_FLAGS} -o libsingular.${SO_SUFFIX} \ |
---|
336 | libsingular-tesths.o iparith.o mpsr_Tok.o claptmpl.o \ |
---|
337 | ${OBJS} -lkernel -L../kernel -L../factory -L../libfac -L${libdir} ${LIBSINGULAR_LIBS} |
---|
338 | |
---|
339 | libsingular.a: mod2.h Makefile version.h $(WIN_LIBS) scanner.cc ${OBJS} \ |
---|
340 | iparith.o libsingular-tesths.o libparse.cc claptmpl.o mpsr_Tok.o |
---|
341 | mkdir libsingular.tmp |
---|
342 | (cd libsingular.tmp; \ |
---|
343 | ar x ../../kernel/libkernel.a; \ |
---|
344 | ar x ../../$(SINGUNAME)/lib/libsingfac.a; \ |
---|
345 | ar x ../../$(SINGUNAME)/lib/libsingcf.a; \ |
---|
346 | ar x ../../$(SINGUNAME)/lib/libntl.a; \ |
---|
347 | ar x ../../$(SINGUNAME)/lib/libomalloc_ndebug.a; \ |
---|
348 | cd ..) |
---|
349 | ar cr libsingular.a \ |
---|
350 | iparith.o mpsr_Tok.o claptmpl.o \ |
---|
351 | ${OBJS} libsingular.tmp/* |
---|
352 | rm -rf libsingular.tmp |
---|
353 | |
---|
354 | libsingular-tesths.o: tesths.cc |
---|
355 | ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} -DLIBSINGULAR \ |
---|
356 | ${SLDFLAGS} -o libsingular-tesths.o \ |
---|
357 | -c tesths.cc |
---|
358 | |
---|
359 | ../modules/python/libpython_module.a: |
---|
360 | cd ../modules/python; scons |
---|
361 | |
---|
362 | %.static: version.h |
---|
363 | ${MAKE} DL_KERNEL=0 S_EXT=".static" $@ |
---|
364 | |
---|
365 | iparith.o mpsr_Tok.o : iparith.inc mpsr_Tok.inc |
---|
366 | |
---|
367 | cntrlc.o cntrlc.og : feOptES.inc feOptTS.inc feOpt.inc |
---|
368 | |
---|
369 | claptmpl.o: claptmpl.cc mod2.h |
---|
370 | ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -c $< |
---|
371 | |
---|
372 | iparith.inc mpsr_Tok.inc: claptmpl.o iparith.cc \ |
---|
373 | ipconv.cc tok.h mpsr_Tok.cc grammar.h mod2.h |
---|
374 | ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} -DGENTABLE \ |
---|
375 | -o gentable claptmpl.o iparith.cc tesths.cc mpsr_Tok.cc \ |
---|
376 | ${OBJS} ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o |
---|
377 | ./gentable |
---|
378 | /bin/rm -f gentable gentable.exe |
---|
379 | |
---|
380 | |
---|
381 | version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in \ |
---|
382 | configure.in |
---|
383 | echo "#define feVersionId " `date '+%Y%m%d%H'` >version.h |
---|
384 | echo "#define CC \"" ${CC} ${CFLAGS} ${DEFS}"\"" >>version.h |
---|
385 | echo "#define CXX \"" ${CXX} ${CXXFLAGS} ${DEFS} "\"" >>version.h |
---|
386 | |
---|
387 | libparse: libparse_main.o utils.o |
---|
388 | ${CXX} ${CPPFLAGS} -DSTANDALONE_PARSER -o libparse libparse_main.o utils.o ../kernel/fegetopt.o ${LDFLAGS2} -lomalloc |
---|
389 | |
---|
390 | libparse_main.o: libparse.cc |
---|
391 | ${CXX} ${CPPFLAGS} -c -o libparse_main.o libparse.cc -DSTANDALONE_PARSER |
---|
392 | |
---|
393 | utils.o: utils.cc |
---|
394 | ${CXX} ${CPPFLAGS} -c -o utils.o utils.cc -DSTANDALONE_PARSER |
---|
395 | |
---|
396 | libparse.cc: libparse.l |
---|
397 | @if test "x${LEX}" = x; then \ |
---|
398 | echo Error: no lex given, could not rebuilt libparse.cc;\ |
---|
399 | exit 1; \ |
---|
400 | fi |
---|
401 | ${LEX} -I -Pyylp -t libparse.l >libparse.cc.lmp |
---|
402 | cp libparse.cc.lmp libparse.cc |
---|
403 | |
---|
404 | # Hmm compiling with -fomit-frame-pointer resulted in access violation |
---|
405 | # under cygwin |
---|
406 | ESingular: mod2.h feOpt.cc version.h emacs.cc \ |
---|
407 | feOptES.inc |
---|
408 | ${CXX} -O2 ${CPPFLAGS} ${DEFS} -DESINGULAR -DPROTO -o ESingular emacs.cc ../kernel/fegetopt.o \ |
---|
409 | ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o |
---|
410 | |
---|
411 | TSingular: mod2.h feOpt.cc version.h emacs.cc \ |
---|
412 | feOptTS.inc |
---|
413 | ${CXX} -O2 ${CPPFLAGS} ${DEFS} -DTSINGULAR -DPROTO -o TSingular emacs.cc ../kernel/fegetopt.o \ |
---|
414 | ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o |
---|
415 | |
---|
416 | feOpt.o: feOpt.inc feOptES.inc feOptTS.inc |
---|
417 | extra.o: feOpt.inc |
---|
418 | |
---|
419 | feOpt.inc: feOpt.cc mod2.h |
---|
420 | $(CXX) -DGENERATE_OPTION_INDEX -I../kernel feOpt.cc -o feOpt |
---|
421 | ./feOpt |
---|
422 | /bin/rm -f feOpt feOpt.exe |
---|
423 | |
---|
424 | feOptES.inc: feOpt.cc mod2.h |
---|
425 | $(CXX) -DGENERATE_OPTION_INDEX -DESINGULAR -I../kernel feOpt.cc -o feOpt |
---|
426 | ./feOpt |
---|
427 | rm -f feOpt feOpt.exe |
---|
428 | |
---|
429 | feOptTS.inc: feOpt.cc mod2.h |
---|
430 | $(CXX) -DGENERATE_OPTION_INDEX -DTSINGULAR -I../kernel feOpt.cc -o feOpt |
---|
431 | ./feOpt |
---|
432 | rm -f feOpt feOpt.exe |
---|
433 | |
---|
434 | mpsr.so: $(MPSR_SOURCES:.cc=.dl_o) |
---|
435 | $(LD) ${SLDFLAGS} -o $@ $^ -L${libdir} ${MP_LIBS} ${GLIBC_DYN_FIX} |
---|
436 | |
---|
437 | dbmsr.so: $(DBMSR_SOURCES:.cc=.dl_o) |
---|
438 | $(LD) ${SLDFLAGS} -o $@ $^ ${GLIBC_DYN_FIX} |
---|
439 | |
---|
440 | src: scanner.cc grammar.h grammar.cc libparse.cc |
---|
441 | |
---|
442 | mod2.h: stamp-h |
---|
443 | |
---|
444 | stamp-h : config.status mod2.h.in |
---|
445 | CONFIG_FILES= CONFIG_HEADERS="mod2.h" ./config.status |
---|
446 | |
---|
447 | Makefile: Makefile.in config.status |
---|
448 | CONFIG_FILES="Makefile" CONFIG_HEADERS= ./config.status |
---|
449 | |
---|
450 | config.status: configure |
---|
451 | ./config.status --recheck |
---|
452 | |
---|
453 | configure: configure.in |
---|
454 | @echo "WARNING: You need to rerun autoconf. I am proceeding, for now." |
---|
455 | @touch configure |
---|
456 | # autoconf |
---|
457 | |
---|
458 | ifeq ($(SINGUNAME),ix86-Win) |
---|
459 | ## |
---|
460 | ## windows only targets |
---|
461 | ## |
---|
462 | |
---|
463 | ## resources |
---|
464 | Singular.rc: Singular.rc.in config.status |
---|
465 | CONFIG_FILES="Singular.rc" CONFIG_HEADERS= ./config.status |
---|
466 | |
---|
467 | ESingular_res.o: Singular.rc |
---|
468 | windres -DESINGULAR -i Singular.rc -o ESingular_res.o |
---|
469 | |
---|
470 | TSingular_res.o: Singular.rc |
---|
471 | windres -DTSINGULAR -i Singular.rc -o TSingular_res.o |
---|
472 | |
---|
473 | Singular_res.o: Singular.rc |
---|
474 | windres -DSINGULAR -i Singular.rc -o Singular_res.o |
---|
475 | |
---|
476 | ## run |
---|
477 | run.o: run.c run.h |
---|
478 | gcc -c -I. -O2 run.c -o run.o |
---|
479 | |
---|
480 | runTSingular : run.o TSingular_res.o |
---|
481 | gcc -mwindows run.o TSingular_res.o -o runTSingular.exe |
---|
482 | # gcc -mwindows -e _mainCRTStartup run.o TSingular_res.o -o runTSingular.exe |
---|
483 | |
---|
484 | runESingular : run.o ESingular_res.o |
---|
485 | gcc -mwindows run.o ESingular_res.o -o runESingular.exe |
---|
486 | # gcc -mwindows -e _mainCRTStartup run.o ESingular_res.o -o runESingular.exe |
---|
487 | |
---|
488 | RUN_SINGULARS=runESingular runTSingular |
---|
489 | |
---|
490 | endif |
---|
491 | |
---|
492 | ## |
---|
493 | ## install targets |
---|
494 | ## |
---|
495 | install: all installbin installslib |
---|
496 | |
---|
497 | install_all: install |
---|
498 | |
---|
499 | install-nolns: all installbin-nolns installslib-nolns |
---|
500 | |
---|
501 | installbin: ${SING_EXEC} libparse ESingular TSingular ${RUN_SINGULARS} |
---|
502 | ${MKINSTALLDIRS} ${bindir} |
---|
503 | ${INSTALL_PROGRAM} ${SING_EXEC} ${SINGULAR} |
---|
504 | -for file in *.so; do \ |
---|
505 | ${INSTALL_PROGRAM} $$file ${bindir}; \ |
---|
506 | done |
---|
507 | ${INSTALL_PROGRAM} libparse ${RUN_SINGULARS} ${bindir} |
---|
508 | ${INSTALL_PROGRAM} ESingular TSingular ${bindir} |
---|
509 | ${INSTALL_PROGRAM} surfex ${bindir} |
---|
510 | chmod a+x ${SINGULAR} |
---|
511 | rm -f ${bindir}/${SING_EXEC}${EXEC_EXT} |
---|
512 | cd ${bindir}; ${LN_S} ${SINGULAR} Singular${EXEC_EXT}; |
---|
513 | |
---|
514 | installbin-nolns: ${SING_EXEC} libparse ESingular TSingular ${RUN_SINGULARS} |
---|
515 | ${MKINSTALLDIRS} ${bindir} |
---|
516 | ${INSTALL_PROGRAM} ${SING_EXEC} ${SINGULAR} |
---|
517 | -for file in *.so; do \ |
---|
518 | ${INSTALL_PROGRAM} $$file ${bindir}; \ |
---|
519 | done |
---|
520 | ${INSTALL_PROGRAM} libparse ${RUN_SINGULARS} ${bindir} |
---|
521 | ${INSTALL_PROGRAM} ESingular TSingular ${DL_LIBS} ${bindir} |
---|
522 | chmod a+x ${SINGULAR} |
---|
523 | rm -f ${bindir}/${SING_EXEC}${EXEC_EXT} |
---|
524 | ${INSTALL_PROGRAM} ${SINGULAR} ${bindir}/Singular${EXEC_EXT}; |
---|
525 | |
---|
526 | installslib: LIB |
---|
527 | test -r ${slibdir} || ${LN_S} `pwd`/LIB ${slibdir} |
---|
528 | |
---|
529 | installslib-nolns: LIB |
---|
530 | ${MKINSTALLDIRS} ${slibdir} |
---|
531 | for file in `pwd`/LIB/*.lib; do \ |
---|
532 | ${INSTALL_DATA} $$file ${slibdir}; \ |
---|
533 | done |
---|
534 | ${MKINSTALLDIRS} ${slibdir}/gftables |
---|
535 | ${INSTALL_DATA} `pwd`/LIB/gftables/* ${slibdir}/gftables/ |
---|
536 | |
---|
537 | install-libsingular: libsingular |
---|
538 | ${MKINSTALLDIRS} ${includedir}/singular |
---|
539 | for file in *.$(SO_SUFFIX); do \ |
---|
540 | ${INSTALL_PROGRAM} $$file ${libdir}; \ |
---|
541 | done |
---|
542 | ${INSTALL_PROGRAM} libsingular.h ${includedir} |
---|
543 | ${INSTALL_PROGRAM} subexpr.h ${includedir}/singular |
---|
544 | ${INSTALL_PROGRAM} tok.h ${includedir}/singular |
---|
545 | ${INSTALL_PROGRAM} grammar.h ${includedir}/singular |
---|
546 | ${INSTALL_PROGRAM} ipid.h ${includedir}/singular |
---|
547 | ${INSTALL_PROGRAM} ipshell.h ${includedir}/singular |
---|
548 | ${INSTALL_PROGRAM} lists.h ${includedir}/singular |
---|
549 | ${INSTALL_PROGRAM} attrib.h ${includedir}/singular |
---|
550 | |
---|
551 | uninstall: uninstallbin |
---|
552 | |
---|
553 | uninstallbin: |
---|
554 | rm -f ${bindir}/Singular${EXEC_EXT} |
---|
555 | rm -f ${SINGULAR} |
---|
556 | -rmdir ${bindir} |
---|
557 | |
---|
558 | ## |
---|
559 | ## clean targest |
---|
560 | ## |
---|
561 | mostlyclean: |
---|
562 | -rm -f Singular Singular-static Singularg Singularp libparse feOpt*.inc |
---|
563 | -rm -f *.o *.og core *.op *.so* *.dl_o* |
---|
564 | -rm -f ESingular* TSingular* |
---|
565 | |
---|
566 | clean: mostlyclean |
---|
567 | -rm -f *.bak *.d *.dd depend |
---|
568 | -rm -f ${slibdir} |
---|
569 | |
---|
570 | distclean: clean |
---|
571 | -rm -f iparith.inc mpsr_Tok.inc stamp.h |
---|
572 | -rm -f Singular* *.gprof *.bprof *~ .\#* version.h |
---|
573 | rm -f plural_cmd.inc |
---|
574 | -rm -f mod2.h Makefile TAGS* tags config.status config.cache config.log |
---|
575 | |
---|
576 | srcclean: |
---|
577 | @echo "This command is intended for maintainers to use;" |
---|
578 | @echo "Rebuilding the deleted files requires flex" |
---|
579 | @echo "bison, perl" |
---|
580 | -rm -f scanner.cc grammar.h grammar.cc libparse.cc |
---|
581 | |
---|
582 | maintainer-clean: distclean srcclean |
---|
583 | @echo "This command is intended for maintainers to use;" |
---|
584 | @echo "Rebuilding the deleted files requires flex" |
---|
585 | @echo "bison, perl and autoconf" |
---|
586 | -rm configure |
---|
587 | |
---|
588 | ## |
---|
589 | ## miscellanous targets |
---|
590 | ## |
---|
591 | LIB/all.lib: LIB/all.lib.tmpl |
---|
592 | ./make_alllib.sh LIB/all.lib.tmpl ${SLIB0} ${PLIBS} |
---|
593 | |
---|
594 | install-bindist: $(HEADERS) $(SOURCES) Makefile depend |
---|
595 | echo "#define MAKE_DISTRIBUTION " > distrib.h |
---|
596 | sleep 1 |
---|
597 | ${MAKE} ${SING_EXEC} ESingular TSingular libparse ${RUN_SINGULARS} |
---|
598 | ${MKINSTALLDIRS} ${install_bindir} |
---|
599 | ${INSTALL_PROGRAM} -s ${SING_EXEC} ${install_bindir}/Singular |
---|
600 | -${INSTALL_PROGRAM} *.so ${install_bindir} |
---|
601 | ${INSTALL_PROGRAM} -s libparse ${RUN_SINGULARS} ESingular TSingular ${DL_LIBS} ${install_bindir} |
---|
602 | ${INSTALL_PROGRAM} surfex ${install_bindir} |
---|
603 | echo "#undef MAKE_DISTRIBUTION " > distrib.h |
---|
604 | |
---|
605 | install-sharedist: ${SLIBS_FILES} LIB/gftables |
---|
606 | ${MKINSTALLDIRS} ${install_slibdir} |
---|
607 | cp ${SLIBS_FILES} ${install_slibdir} |
---|
608 | ${MKINSTALLDIRS} ${install_slibdir}/gftables |
---|
609 | cp ${GFTABLES} ${install_slibdir}/gftables |
---|
610 | ${MKINSTALLDIRS} ${install_slibdir}/surfex |
---|
611 | cp LIB/surfex/surfex.jar ${install_slibdir}/surfex |
---|
612 | chmod -R +rX ${install_slibdir}/* |
---|
613 | |
---|
614 | tar: |
---|
615 | tar cf Singular-${SINGULAR_VERSION}-src.tar ${DISTFILES} |
---|
616 | gzip -f Singular-${SINGULAR_VERSION}-src.tar |
---|
617 | |
---|
618 | backup: tar |
---|
619 | mcopy -o Singular-${SINGULAR_VERSION}-src.tar.gz a: |
---|
620 | |
---|
621 | TAGS: ${SOURCES} ${ESOURCES} ${HEADERS} |
---|
622 | etags ${SOURCES} ${ESOURCES} ${HEADERS} ../kernel/*.[ch] ../kernel/*.cc ../kernel/*.inc |
---|
623 | |
---|
624 | |
---|
625 | tags: |
---|
626 | ctags *.y *.[lch] *.cc *.inc ../kernel/*.[ch] ../kernel/*.cc ../kernel/*.inc |
---|
627 | |
---|
628 | echoLIBS: |
---|
629 | @echo ${SLIBS} |
---|
630 | |
---|
631 | ## |
---|
632 | ## Below here is stuff for developpers |
---|
633 | ################################################################# |
---|
634 | |
---|
635 | |
---|
636 | ## |
---|
637 | ## .og files for having -O and -g object versions available at the same time |
---|
638 | ## |
---|
639 | |
---|
640 | OBJG1 := $(CXXSOURCES:.cc=.og) |
---|
641 | OBJG2 := $(CSOURCES:.c=.og) |
---|
642 | |
---|
643 | OBJG=$(OBJG1) $(OBJG2) |
---|
644 | |
---|
645 | DL_TAILG=\"sog\" |
---|
646 | |
---|
647 | |
---|
648 | ifeq ($(DL_KERNEL),1) |
---|
649 | |
---|
650 | OBJG := $(OBJG) $(DL_KERNEL_SOURCES:.cc=.og) |
---|
651 | DL_LIBSG := $(MPSR_SO:%.so=%.sog) $(DBMSR_SO:%.so=%.sog) |
---|
652 | |
---|
653 | else |
---|
654 | |
---|
655 | OBJG := $(OBJG) $(STATIC_SOURCES:.cc=.og) $(COMMON_SOURCES:.cc=.og) |
---|
656 | DL_LIBSG= |
---|
657 | |
---|
658 | endif |
---|
659 | |
---|
660 | |
---|
661 | ## |
---|
662 | ## compiler and linker options for debug version |
---|
663 | ## |
---|
664 | |
---|
665 | CCG = ${CC} |
---|
666 | CXXG = ${CXX} |
---|
667 | CXXM = gcc -MM -MG -DGENERATE_DEPEND |
---|
668 | CCM = gcc -MM -MG -DGENERATE_DEPEND |
---|
669 | |
---|
670 | CFLAGSG = -g -Wall -Wno-unused ${PIPE} |
---|
671 | CXXFLAGSG = -g -Wall -Wno-unused ${PIPE} |
---|
672 | CXXTEMPLFLAGSG = -fno-implicit-templates |
---|
673 | DEFSG = -D@SING_UNAME@ @DEFS@ -DDL_TAIL=$(DL_TAILG) |
---|
674 | |
---|
675 | ## |
---|
676 | ## Debug Targets |
---|
677 | ## |
---|
678 | |
---|
679 | %.dl_og: %.cc |
---|
680 | ${CXXG} ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} ${SFLAGS} -c $< -o $@ |
---|
681 | |
---|
682 | mpsr.sog: $(MPSR_SOURCES:.cc=.dl_og) |
---|
683 | ${CXXG} ${CXXFLAGSG} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS} ${GLIBC_DYN_FIX} |
---|
684 | |
---|
685 | dbmsr.sog: $(DBMSR_SOURCES:.cc=.dl_og) |
---|
686 | ${CXXG} ${CXXFLAGSG} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS} |
---|
687 | |
---|
688 | claptmpl.og: claptmpl.cc mod2.h |
---|
689 | $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@ |
---|
690 | |
---|
691 | %.og: %.cc |
---|
692 | $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@ |
---|
693 | |
---|
694 | $(OBJG2) : %.og: %.c |
---|
695 | $(CCG) ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@ |
---|
696 | |
---|
697 | Singularg${S_EXT}: scanner.cc $(OBJG) $(DL_LIBSG)\ |
---|
698 | iparith.og mpsr_Tok.og claptmpl.og tesths.cc version.h |
---|
699 | $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -o Singularg${S_EXT} \ |
---|
700 | tesths.cc iparith.og mpsr_Tok.og claptmpl.og $(OBJG) ${LDFLAGSG} ${LIBSG} -lomalloc ../kernel/mmalloc.og \ |
---|
701 | ${LD_DYN_FLAGS} ${LD_LIBC} |
---|
702 | |
---|
703 | iparith.og: iparith.inc iparith.cc |
---|
704 | $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c iparith.cc -o iparith.og |
---|
705 | |
---|
706 | mpsr_Tok.og: iparith.inc mpsr_Tok.cc |
---|
707 | $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${CXXTEMPLFLAGSG} ${DEFSG} -c mpsr_Tok.cc -o mpsr_Tok.og |
---|
708 | |
---|
709 | installg: Singularg |
---|
710 | ${MKINSTALLDIRS} ${bindir} |
---|
711 | ${INSTALL_PROGRAM} Singularg ${bindir} |
---|
712 | |
---|
713 | ESingularg: mod2.h feOpt.cc version.h emacs.cc \ |
---|
714 | feOptES.inc |
---|
715 | ${CXXG} ${CXXFLAGSG} ${CPPFLAGS} -DESINGULAR -g ${DEFSG} -o ESingularg emacs.cc ../kernel/fegetopt.og ${LDFLAGS} ${LIBS} -lomalloc ../kernel/mmalloc.og |
---|
716 | |
---|
717 | ## |
---|
718 | ## .op files for having -O and -g pg object versions available at the same time |
---|
719 | ## |
---|
720 | |
---|
721 | OBJP1 := $(CXXSOURCES:.cc=.op) |
---|
722 | OBJP2 := $(CSOURCES:.c=.op) |
---|
723 | |
---|
724 | OBJP=$(OBJP1) $(OBJP2) |
---|
725 | |
---|
726 | DL_TAILP=\"sop\" |
---|
727 | |
---|
728 | |
---|
729 | ifeq ($(DL_KERNEL),1) |
---|
730 | |
---|
731 | OBJP := $(OBJP) $(DL_KERNEL_SOURCES:.cc=.op) |
---|
732 | DL_LIBSP := $(MPSR_SO:%.so=%.sop) $(DBMSR_SO:%.so=%.sop) |
---|
733 | |
---|
734 | else |
---|
735 | |
---|
736 | OBJP := $(OBJP) $(STATIC_SOURCES:.cc=.op) $(COMMON_SOURCES:.cc=.op) |
---|
737 | DL_LIBSP= |
---|
738 | |
---|
739 | endif |
---|
740 | |
---|
741 | |
---|
742 | ## |
---|
743 | ## compiler and linker options for profiling version |
---|
744 | ## |
---|
745 | |
---|
746 | CCP = ${CC} |
---|
747 | CXXP = ${CXX} |
---|
748 | |
---|
749 | CFLAGSP = -g -pg -O -Wall -Wno-unused ${PIPE} |
---|
750 | CXXFLAGSP = -g -pg -O -Wall -Wno-unused ${PIPE} |
---|
751 | CXXTEMPLFLAGSP = -fno-implicit-templates |
---|
752 | DEFSP = -D@SING_UNAME@ @DEFS@ -DDL_TAIL=$(DL_TAILP) |
---|
753 | |
---|
754 | ## |
---|
755 | ## Profiling Targets |
---|
756 | ## |
---|
757 | |
---|
758 | %.dl_op: %.cc |
---|
759 | ${CXXP} ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} ${SFLAGS} -c $< -o $@ |
---|
760 | |
---|
761 | mpsr.sop: $(MPSR_SOURCES:.cc=.dl_op) |
---|
762 | ${CXXP} ${CXXFLAGSP} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS} ${GLIBC_DYN_FIX} |
---|
763 | |
---|
764 | dbmsr.sop: $(DBMSR_SOURCES:.cc=.dl_op) |
---|
765 | ${CXXP} ${CXXFLAGSP} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS} |
---|
766 | |
---|
767 | claptmpl.op: claptmpl.cc mod2.h |
---|
768 | $(CXXP) ${CXXFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@ |
---|
769 | |
---|
770 | %.op: %.cc |
---|
771 | $(CXXP) ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@ |
---|
772 | |
---|
773 | $(OBJP2) : %.op: %.c |
---|
774 | $(CCP) ${CFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@ |
---|
775 | |
---|
776 | Singularp${S_EXT}: scanner.cc $(OBJP) $(DL_LIBSP)\ |
---|
777 | iparith.op mpsr_Tok.op claptmpl.op tesths.cc version.h |
---|
778 | (cd ../kernel;make libkernel_p.a;make install;cd ../Singular) |
---|
779 | $(CXXP) ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} -o Singularp${S_EXT} \ |
---|
780 | tesths.cc iparith.op mpsr_Tok.op claptmpl.op $(OBJP) ${LDFLAGSP} ${LIBSP} -lomalloc ../kernel/mmalloc.op \ |
---|
781 | ${LD_DYN_FLAGS} ${LD_LIBC} |
---|
782 | |
---|
783 | iparith.op: iparith.inc iparith.cc |
---|
784 | $(CXXP) ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} -c iparith.cc -o iparith.op |
---|
785 | |
---|
786 | mpsr_Tok.op: iparith.inc mpsr_Tok.cc |
---|
787 | $(CXXP) ${CXXFLAGSP} ${CPPFLAGS} ${CXXTEMPLFLAGSP} ${DEFSP} -c mpsr_Tok.cc -o mpsr_Tok.op |
---|
788 | |
---|
789 | installp: Singularp |
---|
790 | ${MKINSTALLDIRS} ${bindir} |
---|
791 | ${INSTALL_PROGRAM} Singularp ${bindir} |
---|
792 | |
---|
793 | ## |
---|
794 | ## dependencies |
---|
795 | ## |
---|
796 | |
---|
797 | %.dd: %.cc mod2.h |
---|
798 | echo $(@:.dd=.og) $(@:.dd=.op) $(@:.dd=.dl_o) $(@:.dd=.dl_og) $(@:.dd=.dl_op)" " \\ > $@ |
---|
799 | $(CXXM) -DGENTABLE ${CPPFLAGS} ${DEFSG} $< >> $@ |
---|
800 | |
---|
801 | %.d: %.c mod2.h |
---|
802 | echo $(@:.d=.og) $(@:.d=.op)" " \\ > $@ |
---|
803 | $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@ |
---|
804 | |
---|
805 | depend: $(CXXSOURCES:.cc=.dd) $(ESOURCES:.cc=.dd) $(CSOURCES:.c=.d) mod2.h claptmpl.dd |
---|
806 | -cat *.dd >depend |
---|
807 | |
---|
808 | ifeq (depend,$(wildcard depend)) |
---|
809 | include depend |
---|
810 | endif |
---|
811 | |
---|
812 | |
---|