source: git/Singular/Makefile.in @ 2b78bd

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