source: git/Singular/Makefile.in @ 8080db

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