source: git/Singular/Makefile.in @ 0e5a3e

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