source: git/Singular/Makefile.in.SAVE @ 151a06

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