source: git/Singular/Makefile.am @ b773c0

spielwiese
Last change on this file since b773c0 was b773c0, checked in by Oleksandr Motsak <motsak@…>, 11 years ago
Making Singular usable in builddir (without 'make install')
  • Property mode set to 100644
File size: 14.2 KB
Line 
1# PIPE = -pipe
2# ???
3#LD_DYN_FLAGS   = -ldl -rdynamic
4#SFLAGS         = -fpic -DPIC
5#SLDFLAGS       = -shared
6#LD_LIBC                = -lc
7#STATIC_LDFLAGS = -static
8
9WARNCFLAGS = -Wunused-parameter
10# clang has also: -Wunneeded-internal-declaration
11
12NODEBUGCFLAGS   = -O3 -w -fomit-frame-pointer $(WARNCFLAGS)
13NODEBUGCXXFLAGS = -O3 -w -fomit-frame-pointer $(WARNCFLAGS)
14NODEBUGDEFS = -DNDEBUG -DOM_NDEBUG
15
16CXXTEMPLFLAGS =-ftrapv ## -fno-implicit-templates
17
18AM_CPPFLAGS = -I${top_srcdir} -I${top_builddir} -I${top_srcdir}/numeric -I${top_builddir}/numeric -I${top_srcdir}/kernel -I${top_builddir}/kernel -I${top_srcdir}/libpolys -I${top_builddir}/libpolys $(GMP_CFLAGS) -I${top_srcdir}/factory/include -I${top_builddir}/factory/include $(FACTORY_CFLAGS) $(NTL_CFLAGS) $(FLINT_CFLAGS) ${EMBED_PYOBJECT_CFLAGS}
19
20########################### libSingular* #########################
21
22if WANT_DEBUG
23  LIB_G=libSingular_g.la
24else
25  LIB_G=
26endif
27
28libSingular_LTLIBRARIES = libSingular.la ${LIB_G}
29libSingulardir = $(libdir)/singular
30
31libSingular_la_CFLAGS   = -O3 -fomit-frame-pointer -Wextra -Wall -Wno-long-long ${PIPE}  $(WARNCFLAGS)
32libSingular_g_la_CFLAGS = -g -Wextra -Wall -Wno-long-long -pedantic ${PIPE}  $(WARNCFLAGS)
33
34libSingular_la_CXXFLAGS   = -O3 -fomit-frame-pointer -Wextra -Wall -Wno-long-long ${PIPE} $(CXXTEMPLFLAGS)  $(WARNCFLAGS)
35libSingular_g_la_CXXFLAGS = -g -Wextra -Wall -Wno-long-long -pedantic ${PIPE} $(CXXTEMPLFLAGS)   $(WARNCFLAGS)
36# -fdiagnostics-show-option
37
38
39libSingular_la_CPPFLAGS   = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG -DLIBSINGULAR
40libSingular_g_la_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DLIBSINGULAR
41
42SOURCES =    Minor.cc\
43   MinorInterface.cc\
44   MinorProcessor.cc\
45   attrib.cc\
46   bbcone.cc\
47   bbfan.cc\
48   bigintm.cc\
49   blackbox.cc\
50   calcSVD.cc\
51   cntrlc.cc\
52   countedref.cc\
53   denom_list.cc\
54   eigenval_ip.cc\
55   extra.cc\
56   feOpt.cc\
57   fehelp.cc\
58   fevoices.cc\
59   fglm.cc\
60   gms.cc\
61   grammar.cc\
62   interpolation.cc\
63   iparith.cc\
64   ipassign.cc\
65   ipconv.cc\
66   ipid.cc\
67   iplib.cc\
68   ipprint.cc\
69   ipshell.cc\
70   janet.cc\
71   libparse.cc\
72   linearAlgebra_ip.cc\
73   lists.cc\
74   maps_ip.cc\
75   minpoly.cc\
76   misc_ip.cc\
77   links/ndbm.cc\
78   newstruct.cc\
79   pcv.cc\
80   links/pipeLink.cc\
81   scanner.cc\
82   sdb.cc\
83   links/s_buff.cc\
84   links/silink.cc\
85   links/sing_dbm.cc\
86   sing_win.cc\
87   slInit_Static.cc\
88   links/ssiLink.cc\
89   subexpr.cc\
90   pyobject_setup.cc\
91   walk.cc\
92   walk_ip.cc\
93   wrapper.cc\
94   fereadl.c mmstd.c claptmpl.cc
95
96#   slInit_Dynamic.cc
97
98libSingular_la_SOURCES   = $(SOURCES) feOpt.inc
99libSingular_g_la_SOURCES = $(SOURCES) feOpt.inc
100
101SingularHEADERS =    Cache.h \
102   CacheImplementation.h \
103   Minor.h \
104   MinorInterface.h \
105   MinorProcessor.h \
106   attrib.h \
107   bigintm.h \
108   blackbox.h \
109   cntrlc.h \
110   countedref.h \
111   links/dbm_sl.h \
112   distrib.h \
113   eigenval_ip.h \
114   feOpt.h feOptTab.h fehelp.h \
115   fglm.h \
116   gms.h \
117   grammar.h \
118   interpolation.h \
119   idrec.h \
120   ipconv.h \
121   ipid.h \
122   ipprint.h \
123   ipshell.h \
124   janet.h \
125   libparse.h \
126   libsingular.h \
127   linearAlgebra_ip.h\
128   lists.h \
129   locals.h \
130   maps_ip.h \
131   minpoly.h \
132   misc_ip.h \
133   mmalloc.h \
134   omSingularConfig.h \
135   links/ndbm.h \
136   newstruct.h \
137   pcv.h \
138   links/pipeLink.h \
139   pyobject_setup.h \
140   run.h \
141   sdb.h \
142   silink.h \
143   links/s_buff.h \
144   links/sing_dbm.h \
145   sing_win.h \
146   slInit.h \
147   links/ssiLink.h \
148   stype.h \
149   subexpr.h \
150   table.h \
151   tok.h \
152   walk.h
153
154# plural_cmd.inc
155nodist_libSingular_la_SOURCES = iparith.inc
156nodist_libSingular_g_la_SOURCES = iparith.inc
157
158noinst_HEADERS = version.h
159
160
161libSingular_includedir = ${includedir}/singular/Singular/
162nobase_libSingular_include_HEADERS = $(SingularHEADERS)
163
164if ENABLE_FACTORY
165  USE_FACTORY = -L${top_builddir}/factory
166else
167  USE_FACTORY =
168endif
169
170#########################################################
171# handle all the generated *.inc
172
173noinst_PROGRAMS = gentable1 feOptGen feOptES feOptTS
174
175gentable1_SOURCES = gentable.cc grammar.h tok.h table.h
176gentable1_CFLAGS = -O3 -fomit-frame-pointer ${PIPE}
177gentable1_CXXFLAGS = -O3 -fomit-frame-pointer -Wextra -Wall -Wno-long-long ${PIPE} $(CXXTEMPLFLAGS)
178gentable1_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG
179
180feOptGen_SOURCES = feOptGen.cc feOptGen.h
181feOptGen_CXXFLAGS = -O3 -fomit-frame-pointer -Wextra -Wall -Wno-long-long ${PIPE} $(CXXTEMPLFLAGS)
182feOptGen_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG
183
184feOptES_SOURCES = feOptGen.cc feOptGen.h
185feOptES_CXXFLAGS = -O3 -fomit-frame-pointer -Wextra -Wall -Wno-long-long ${PIPE} $(CXXTEMPLFLAGS)
186feOptES_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG -DESINGULAR
187
188feOptTS_SOURCES = feOptGen.cc feOptGen.h
189feOptTS_CXXFLAGS = -O3 -fomit-frame-pointer -Wextra -Wall -Wno-long-long ${PIPE} $(CXXTEMPLFLAGS)
190feOptTS_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG -DTSINGULAR
191
192########################### Singular* #########################
193
194if WANT_DEBUG
195  EXTRA_PROGRAMS = Singulard Singulardg libparse
196else
197  EXTRA_PROGRAMS = Singulard libparse
198endif
199
200# the "optional_programs" variable should be defined in the configure
201# script, and listed in an AC_SUBST macro
202optional_Singular_programs =
203
204if WANT_DEBUG
205  bin_PROGRAMS = Singular Singularg ESingular TSingular $(optional_Singular_programs)
206else
207  bin_PROGRAMS = Singular ESingular TSingular $(optional_Singular_programs)
208endif
209
210Singular Singularg ESingular TSingular $(optional_Singular_programs): ${abs_builddir}/LIB
211
212AMLDFLAGS = -L${top_builddir}/Singular -L${top_builddir}/numeric -L${top_builddir}/kernel -L${top_builddir}/libpolys/polys  -L${top_builddir}/libpolys/coeffs -L${top_builddir}/libpolys/reporter -L${top_builddir}/libpolys/misc $(USE_FACTORY) -L${top_builddir}/omalloc -L${top_builddir}/findexec
213
214Singular_CFLAGS = -O3 -fomit-frame-pointer ${PIPE}
215Singularg_CFLAGS = -g ${PIPE}
216
217Singular_CXXFLAGS = -O3 -fomit-frame-pointer -Wextra -Wall -Wno-long-long ${PIPE} $(CXXTEMPLFLAGS)
218Singularg_CXXFLAGS = -g -Wextra -Wall -Wno-long-long -pedantic ${PIPE} $(CXXTEMPLFLAGS)
219
220nodist_Singular_SOURCES = libSingular.la
221nodist_Singularg_SOURCES =  libSingular_g.la
222
223Singular_SOURCES = tesths.cc fegetopt.c fegetopt.h utils.cc  utils.h
224Singularg_SOURCES = tesths.cc fegetopt.c fegetopt.h utils.cc  utils.h
225
226Singular_LDADD = libSingular.la ${top_builddir}/numeric/libnumeric.la ${top_builddir}/kernel/libkernel.la ${top_builddir}/libpolys/polys/libpolys.la -lcoeffs -lreporter -lmisc $(FACTORY_LIBS) -lomalloc -lfindexec $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} ${EMBED_PYOBJECT_LDFLAGS}
227Singularg_LDADD = libSingular_g.la ${top_builddir}/numeric/libnumeric_g.la ${top_builddir}/kernel/libkernel_g.la ${top_builddir}/libpolys/polys/libpolys_g.la -lcoeffs_g -lreporter_g -lmisc_g $(FACTORY_LIBS) -lomalloc_g -lfindexec_g $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS}  ${USEPPROCSDYNAMICLD} ${EMBED_PYOBJECT_LDFLAGS}
228
229Singular_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG
230Singularg_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H
231
232Singular_LDFLAGS = -static ${AMLDFLAGS}
233Singularg_LDFLAGS = -static ${AMLDFLAGS}
234
235
236Singulard_CFLAGS = -O3 -fomit-frame-pointer ${PIPE}
237Singulardg_CFLAGS = -g ${PIPE}
238
239Singulard_CXXFLAGS = -O3 -fomit-frame-pointer -Wextra -Wall -Wno-long-long ${PIPE} $(CXXTEMPLFLAGS)
240Singulardg_CXXFLAGS = -g -Wextra -Wall -Wno-long-long -pedantic ${PIPE} $(CXXTEMPLFLAGS)
241
242Singulard_SOURCES = tesths.cc fegetopt.c fegetopt.h utils.cc  utils.h
243nodist_Singulard_SOURCES = libSingular.la
244
245Singulardg_SOURCES = tesths.cc fegetopt.c fegetopt.h utils.cc  utils.h
246nodist_Singulardg_SOURCES =  libSingular_g.la
247
248Singulard_LDADD = libSingular.la -lnumeric -lkernel -lpolys -lcoeffs -lreporter -lmisc $(FACTORY_LIBS) -lomalloc -lfindexec $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} ${EMBED_PYOBJECT_LDFLAGS}
249Singulardg_LDADD = libSingular_g.la -lnumeric_g -lkernel_g -lpolys_g -lcoeffs_g -lreporter_g -lmisc_g $(FACTORY_LIBS) -lomalloc_g -lfindexec_g $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS}  ${USEPPROCSDYNAMICLD} ${EMBED_PYOBJECT_LDFLAGS}
250
251Singulard_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG
252Singulardg_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H
253
254Singulard_LDFLAGS = ${AMLDFLAGS}
255Singulardg_LDFLAGS = ${AMLDFLAGS}
256
257
258#### ESingular
259
260ESingular_CFLAGS = -O3 -fomit-frame-pointer ${PIPE}
261ESingular_CXXFLAGS = -O3 -fomit-frame-pointer -Wextra -Wall -Wno-long-long ${PIPE} $(CXXTEMPLFLAGS)
262ESingular_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG -DESINGULAR -DPROTO
263ESingular_LDFLAGS = -static ${AMLDFLAGS}
264ESingular_LDADD =   -lreporter -lmisc -lomalloc -lfindexec
265
266ESingular_SOURCES = emacs.cc fegetopt.c fegetopt.h feOptES.inc feOpt.cc
267
268#### same for TSingular
269
270TSingular_CFLAGS = -O3 -fomit-frame-pointer ${PIPE}
271TSingular_CXXFLAGS = -O3 -fomit-frame-pointer -Wextra -Wall -Wno-long-long ${PIPE} $(CXXTEMPLFLAGS)
272TSingular_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG -DTSINGULAR -DPROTO
273TSingular_LDFLAGS = -static ${AMLDFLAGS}
274TSingular_LDADD =   -lreporter -lmisc -lomalloc -lfindexec
275
276TSingular_SOURCES = emacs.cc fegetopt.c fegetopt.h feOptTS.inc feOpt.cc
277# utils.cc utils.h
278
279
280#### libparse
281libparse_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG -DSTANDALONE_PARSER
282libparse_CFLAGS = -O3 -fomit-frame-pointer ${PIPE}
283libparse_CXXFLAGS = -O3 -fomit-frame-pointer -Wextra -Wall -Wno-long-long ${PIPE} $(CXXTEMPLFLAGS)
284 
285libparse_SOURCES = libparse.cc fegetopt.c fegetopt.h utils.cc  utils.h
286# nodist_libparse_SOURCES = libSingular.la
287 
288# # libSingular.la -lnumeric
289libparse_LDADD = -lomalloc
290libparse_LDFLAGS = -static ${AMLDFLAGS}
291# TODO for libparse:
292# multiple definition of `category_out': libparse.cc v.s. utils.cc
293# undefined reference to `iiInitSingularProcinfo(procinfo*, char const*, char const*, int, long, int)'
294
295#########################################################
296# the Singular library (*.lib files)
297
298include ${srcdir}/singular-libs
299
300singularlibrarydir = ${datadir}/singular
301singularlibrary = $(SLIB0:%=LIB/%) $(SLIB1:%=LIB/%) $(PLIBS:%=LIB/%)
302nobase_dist_singularlibrary_DATA = LIB/tst.lib LIB/help.cnf ${singularlibrary}
303EXTRA_DIST = make_alllib.sh LIB/all.lib.tmpl singular-libs LIB/help.cnf
304
305# ${nobase_dist_singularlibrary_DATA}
306
307singularalllibrarydir = ${datadir}/singular/LIB
308singularalllibrary = all.lib
309nobase_dist_singularalllibrary_DATA = all.lib
310
311all.lib: ${srcdir}/make_alllib.sh ${srcdir}/LIB/all.lib.tmpl ${singularlibrary}
312        ${srcdir}/make_alllib.sh ${srcdir}/LIB/all.lib.tmpl ${SLIB0} ${PLIBS}
313
314########################### TEST #########################
315
316TESTS_ENVIRONMENT = SINGULARPATH='${top_builddir}/Singular/LIB:${top_srcdir}/Singular/LIB:${top_builddir}/libpolys/polys/.libs:${top_builddir}/factory/gftables'
317TESTS_ENVIRONMENT += SINGULAR_ROOT_DIR='${top_builddir}'
318
319if WANT_DEBUG
320TESTS=test-s-g test-s-r test-d-g test-d-r
321else
322TESTS=test-s-r test-d-r
323endif
324check_PROGRAMS=$(TESTS)
325
326# Static versions
327
328test_s_r_CFLAGS = -O3 -fomit-frame-pointer ${PIPE}
329test_s_g_CFLAGS = ${PIPE}
330
331test_s_r_CXXFLAGS = -O3 -fomit-frame-pointer -Wextra -Wall -Wno-long-long ${PIPE} $(CXXTEMPLFLAGS)
332test_s_g_CXXFLAGS = -g -Wextra -Wall -Wno-long-long -pedantic ${PIPE} $(CXXTEMPLFLAGS)
333
334test_s_r_SOURCES = test.cc
335test_s_g_SOURCES = test.cc
336
337test_s_r_LDADD = libSingular.la -lnumeric -lkernel -lpolys -lcoeffs -lreporter -lmisc $(FACTORY_LIBS) -lomalloc -lfindexec $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} ${EMBED_PYOBJECT_LDFLAGS}
338test_s_g_LDADD = libSingular_g.la -lnumeric_g -lkernel_g -lpolys_g -lcoeffs_g -lreporter_g -lmisc_g $(FACTORY_LIBS) -lomalloc_g -lfindexec_g $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS}  ${USEPPROCSDYNAMICLD} ${EMBED_PYOBJECT_LDFLAGS}
339
340test_s_r_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG
341test_s_g_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H
342
343test_s_r_LDFLAGS = -static ${AMLDFLAGS}
344test_s_g_LDFLAGS = -static ${AMLDFLAGS}
345
346
347# Dynamic versions
348
349test_d_r_CFLAGS = -O3 -fomit-frame-pointer ${PIPE}
350test_d_g_CFLAGS = ${PIPE}
351
352test_d_r_CXXFLAGS = -O3 -fomit-frame-pointer -Wextra -Wall -Wno-long-long ${PIPE} $(CXXTEMPLFLAGS)
353test_d_g_CXXFLAGS = -g -Wextra -Wall -Wno-long-long -pedantic ${PIPE} $(CXXTEMPLFLAGS)
354
355test_d_r_SOURCES = test.cc
356test_d_g_SOURCES = test.cc
357
358test_d_r_LDADD = libSingular.la -lnumeric -lkernel -lpolys -lcoeffs -lreporter -lmisc $(FACTORY_LIBS) -lomalloc -lfindexec $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} ${EMBED_PYOBJECT_LDFLAGS}
359test_d_g_LDADD = libSingular_g.la -lnumeric_g -lkernel_g -lpolys_g -lcoeffs_g -lreporter_g -lmisc_g $(FACTORY_LIBS) -lomalloc_g -lfindexec_g $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS}  ${USEPPROCSDYNAMICLD} ${EMBED_PYOBJECT_LDFLAGS}
360
361test_d_r_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG
362test_d_g_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H
363
364test_d_r_LDFLAGS = ${AMLDFLAGS}
365test_d_g_LDFLAGS = ${AMLDFLAGS}
366
367#########################################################
368
369# These files are built first
370BUILT_SOURCES = feOpt.inc feOptTS.inc feOptES.inc iparith.inc all.lib plural_cmd.inc \
371                gftables MOD
372
373CLEANFILES = $(BUILT_SOURCES) $(EXTRA_PROGRAMS)
374
375clean-local:
376        [ -L ${abs_builddir}/LIB ] && unlink ${abs_builddir}/LIB
377                 
378feOpt.inc: feOptGen
379        ${builddir}/feOptGen
380
381feOptES.inc: feOptES
382        ${builddir}/feOptES
383
384feOptTS.inc: feOptTS
385        ${builddir}/feOptTS
386
387plural_cmd.inc iparith.inc: gentable1
388        ${builddir}/gentable1
389
390# # fake rule to fix parallel make http://www.gnu.org/s/hello/manual/automake/Multiple-Outputs.html
391# plural_cmd.inc: iparith.inc
392
393
394gftables: ${top_srcdir}/factory/gftables
395        ln -snf ${top_srcdir}/factory/gftables ${builddir}/gftables
396
397${abs_builddir}/LIB: ${srcdir}/LIB
398        ln -sn ${abs_srcdir}/LIB ${abs_builddir}/
399
400MOD: ${top_builddir}/libpolys/polys/.libs
401        ln -snf ${top_builddir}/libpolys/polys/.libs/ ${builddir}/MOD
402
403if PYTHON_MODULE
404   moduledir = $(bindir)/MOD
405   module_LTLIBRARIES = pyobject.la
406   pyobject_la_SOURCES = pyobject.cc
407
408   pyobject_la_CPPFLAGS   = ${AM_CPPFLAGS} ${NODEBUGDEFS}
409   pyobject_g_la_CPPFLAGS = ${AM_CPPFLAGS}
410
411   pyobject_la_CXXFLAGS   = ${NODEBUGCXXFLAGS} @PYTHON_CSPEC@
412   pyobject_g_la_CXXFLAGS = ${DEBUGCXXFLAGS} @PYTHON_CSPEC@
413
414   pyobject_la_LDFLAGS = -export-dynamic -shared -module -avoid-version \
415     ${AMLDFLAGS} @PYTHON_LSPEC@
416endif
Note: See TracBrowser for help on using the repository browser.