source: git/Singular/Makefile.in @ c0e207f

spielwiese
Last change on this file since c0e207f was c0e207f, checked in by Hans Schönemann <hannes@…>, 15 years ago
*hannes: profiling git-svn-id: file:///usr/local/Singular/svn/trunk@11804 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 21.6 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_ndebug
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_ndebug  -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/libsingcf.a; \
344        ar x ../../$(SINGUNAME)/lib/libntl.a; \
345        ar x ../../$(SINGUNAME)/lib/libomalloc_ndebug.a; \
346        cd ..)
347        ar cr libsingular.a \
348        iparith.o mpsr_Tok.o claptmpl.o \
349        ${OBJS} libsingular.tmp/*
350        rm -rf libsingular.tmp
351
352libsingular-tesths.o: tesths.cc
353        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} -DLIBSINGULAR \
354          ${SLDFLAGS} -o libsingular-tesths.o \
355          -c tesths.cc
356
357../modules/python/libpython_module.a:
358        cd ../modules/python; scons
359
360%.static: version.h
361        ${MAKE} DL_KERNEL=0 S_EXT=".static" $@
362
363iparith.o mpsr_Tok.o : iparith.inc mpsr_Tok.inc
364
365cntrlc.o cntrlc.og : feOptES.inc feOptTS.inc feOpt.inc
366
367claptmpl.o: claptmpl.cc mod2.h
368        ${CXX} ${CXXFLAGS}  ${CPPFLAGS} ${DEFS} -c $<
369
370iparith.inc mpsr_Tok.inc: claptmpl.o iparith.cc \
371                          ipconv.cc tok.h mpsr_Tok.cc grammar.h mod2.h
372        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} -DGENTABLE \
373             -o gentable claptmpl.o iparith.cc tesths.cc mpsr_Tok.cc \
374             ${OBJS} ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o
375        ./gentable
376        /bin/rm -f gentable gentable.exe
377
378
379version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in \
380           configure.in
381        echo "#define feVersionId "  `date '+%Y%m%d%H'` >version.h
382        echo "#define CC \"" ${CC} ${CFLAGS} ${DEFS}"\"" >>version.h
383        echo "#define CXX \"" ${CXX} ${CXXFLAGS} ${DEFS} "\"" >>version.h
384
385libparse: libparse_main.o utils.o
386        ${CXX}  ${CPPFLAGS} -DSTANDALONE_PARSER -o libparse libparse_main.o utils.o ../kernel/fegetopt.o ${LDFLAGS2} -lomalloc_ndebug
387
388libparse_main.o: libparse.cc
389        ${CXX} ${CPPFLAGS} -c -o libparse_main.o libparse.cc  -DSTANDALONE_PARSER
390
391libparse.cc: libparse.l
392        @if test "x${LEX}" = x; then \
393                echo Error: no lex given, could not rebuilt libparse.cc;\
394                exit 1; \
395        fi
396        ${LEX} -I -Pyylp -t libparse.l >libparse.cc.lmp
397        cp libparse.cc.lmp libparse.cc
398
399# Hmm compiling with -fomit-frame-pointer resulted in access violation
400# under cygwin
401ESingular: mod2.h feOpt.cc version.h emacs.cc \
402           feOptES.inc
403        ${CXX} -O2 ${CPPFLAGS} ${DEFS} -DESINGULAR -DPROTO -o ESingular emacs.cc ../kernel/fegetopt.o \
404        ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o
405
406TSingular: mod2.h feOpt.cc version.h emacs.cc \
407           feOptTS.inc
408        ${CXX} -O2 ${CPPFLAGS} ${DEFS} -DTSINGULAR -DPROTO -o TSingular emacs.cc ../kernel/fegetopt.o \
409        ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o
410
411feOpt.o: feOpt.inc feOptES.inc feOptTS.inc
412extra.o: feOpt.inc
413
414feOpt.inc: feOpt.cc mod2.h
415        $(CXX) -DGENERATE_OPTION_INDEX -I../kernel feOpt.cc -o feOpt
416        ./feOpt
417        /bin/rm -f feOpt feOpt.exe
418
419feOptES.inc: feOpt.cc mod2.h
420        $(CXX) -DGENERATE_OPTION_INDEX  -DESINGULAR -I../kernel feOpt.cc -o feOpt
421        ./feOpt
422        rm -f feOpt feOpt.exe
423
424feOptTS.inc: feOpt.cc mod2.h
425        $(CXX) -DGENERATE_OPTION_INDEX  -DTSINGULAR -I../kernel feOpt.cc -o feOpt
426        ./feOpt
427        rm -f feOpt feOpt.exe
428
429mpsr.so: $(MPSR_SOURCES:.cc=.dl_o)
430        $(LD) ${SLDFLAGS} -o $@ $^ -L${libdir} ${MP_LIBS} ${GLIBC_DYN_FIX}
431
432dbmsr.so: $(DBMSR_SOURCES:.cc=.dl_o)
433        $(LD) ${SLDFLAGS} -o $@ $^ ${GLIBC_DYN_FIX}
434
435src: scanner.cc grammar.h grammar.cc libparse.cc
436
437mod2.h: stamp-h
438
439stamp-h : config.status mod2.h.in
440        CONFIG_FILES= CONFIG_HEADERS="mod2.h" ./config.status
441
442Makefile: Makefile.in config.status
443        CONFIG_FILES="Makefile" CONFIG_HEADERS= ./config.status
444
445config.status: configure
446        ./config.status --recheck
447
448configure: configure.in
449        @echo "WARNING: You need to rerun autoconf. I am proceeding, for now."
450        @touch configure
451#       autoconf
452
453ifeq ($(SINGUNAME),ix86-Win)
454##
455## windows only targets
456##
457
458## resources
459Singular.rc: Singular.rc.in config.status
460        CONFIG_FILES="Singular.rc" CONFIG_HEADERS= ./config.status
461
462ESingular_res.o: Singular.rc
463        windres -DESINGULAR -i Singular.rc -o ESingular_res.o
464
465TSingular_res.o: Singular.rc
466        windres -DTSINGULAR -i Singular.rc -o TSingular_res.o
467
468Singular_res.o: Singular.rc
469        windres -DSINGULAR -i Singular.rc -o Singular_res.o
470
471## run
472run.o: run.c run.h
473        gcc -c -I. -O2 run.c -o run.o
474
475runTSingular : run.o TSingular_res.o
476        gcc -mwindows run.o TSingular_res.o -o runTSingular.exe
477#       gcc -mwindows -e _mainCRTStartup run.o TSingular_res.o -o runTSingular.exe
478
479runESingular : run.o ESingular_res.o
480        gcc -mwindows run.o ESingular_res.o -o runESingular.exe
481#       gcc -mwindows -e _mainCRTStartup run.o ESingular_res.o -o runESingular.exe
482
483RUN_SINGULARS=runESingular runTSingular
484
485endif
486
487##
488## install targets
489##
490install: all installbin installslib
491
492install-nolns: all installbin-nolns installslib-nolns
493
494installbin: ${SING_EXEC} libparse ESingular TSingular ${RUN_SINGULARS}
495        ${MKINSTALLDIRS} ${bindir}
496        ${INSTALL_PROGRAM} ${SING_EXEC} ${SINGULAR}
497        -for file in *.so; do \
498          ${INSTALL_PROGRAM} $$file ${bindir}; \
499        done
500        ${INSTALL_PROGRAM} libparse ${RUN_SINGULARS} ${bindir}
501        ${INSTALL_PROGRAM} ESingular TSingular ${bindir}
502        ${INSTALL_PROGRAM} surfex ${bindir}
503        chmod a+x ${SINGULAR}
504        rm -f ${bindir}/${SING_EXEC}${EXEC_EXT}
505        cd ${bindir}; ${LN_S} ${SINGULAR} Singular${EXEC_EXT};
506
507installbin-nolns: ${SING_EXEC} libparse ESingular TSingular ${RUN_SINGULARS}
508        ${MKINSTALLDIRS} ${bindir}
509        ${INSTALL_PROGRAM} ${SING_EXEC} ${SINGULAR}
510        -for file in *.so; do \
511          ${INSTALL_PROGRAM} $$file ${bindir}; \
512        done
513        ${INSTALL_PROGRAM} libparse ${RUN_SINGULARS} ${bindir}
514        ${INSTALL_PROGRAM} ESingular TSingular ${DL_LIBS} ${bindir}
515        chmod a+x ${SINGULAR}
516        rm -f ${bindir}/${SING_EXEC}${EXEC_EXT}
517        ${INSTALL_PROGRAM} ${SINGULAR} ${bindir}/Singular${EXEC_EXT};
518
519installslib: LIB
520        test -r ${slibdir} || ${LN_S} `pwd`/LIB ${slibdir}
521
522installslib-nolns: LIB
523        ${MKINSTALLDIRS} ${slibdir}
524        for file in `pwd`/LIB/*.lib; do \
525          ${INSTALL_DATA}  $$file ${slibdir}; \
526        done
527        ${MKINSTALLDIRS} ${slibdir}/gftables
528        ${INSTALL_DATA} `pwd`/LIB/gftables/* ${slibdir}/gftables/
529
530install-libsingular: libsingular
531        for file in *.$(SO_SUFFIX); do \
532          ${INSTALL_PROGRAM}  $$file ${libdir}; \
533        done
534        ${INSTALL_PROGRAM} libsingular.h ${includedir}
535
536
537
538uninstall: uninstallbin
539
540uninstallbin:
541        rm -f ${bindir}/Singular${EXEC_EXT}
542        rm -f ${SINGULAR}
543        -rmdir ${bindir}
544
545##
546## clean targest
547##
548mostlyclean:
549        -rm -f Singular Singular-static Singularg Singularp libparse feOpt*.inc
550        -rm -f *.o *.og core *.op *.so* *.dl_o*
551        -rm -f ESingular* TSingular*
552
553clean: mostlyclean
554        -rm -f *.bak *.d *.dd depend
555        -rm -f ${slibdir}
556
557distclean: clean
558        -rm -f iparith.inc mpsr_Tok.inc stamp.h
559        -rm -f Singular* *.gprof *.bprof *~ .\#* version.h
560        rm -f plural_cmd.inc
561        -rm -f mod2.h Makefile TAGS* tags config.status config.cache config.log
562
563srcclean:
564        @echo "This command is intended for maintainers to use;"
565        @echo "Rebuilding the deleted files requires flex"
566        @echo "bison, perl"
567        -rm -f scanner.cc grammar.h grammar.cc libparse.cc
568
569maintainer-clean: distclean srcclean
570        @echo "This command is intended for maintainers to use;"
571        @echo "Rebuilding the deleted files requires flex"
572        @echo "bison, perl and autoconf"
573        -rm configure
574
575##
576## miscellanous targets
577##
578LIB/all.lib:    LIB/all.lib.tmpl
579        ./make_alllib.sh LIB/all.lib.tmpl ${SLIB0} ${PLIBS}
580
581install-bindist: $(HEADERS) $(SOURCES) Makefile depend
582        echo "#define MAKE_DISTRIBUTION " > distrib.h
583        sleep 1
584        ${MAKE} ${SING_EXEC} ESingular TSingular libparse ${RUN_SINGULARS}
585        ${MKINSTALLDIRS} ${install_bindir}
586        ${INSTALL_PROGRAM} -s  ${SING_EXEC} ${install_bindir}/Singular
587        -${INSTALL_PROGRAM} *.so ${install_bindir}
588        ${INSTALL_PROGRAM} -s  libparse ${RUN_SINGULARS} ESingular TSingular ${DL_LIBS} ${install_bindir}
589        ${INSTALL_PROGRAM} surfex ${install_bindir}
590        echo "#undef MAKE_DISTRIBUTION " > distrib.h
591
592install-sharedist: ${SLIBS_FILES} LIB/gftables
593        ${MKINSTALLDIRS} ${install_slibdir}
594        cp ${SLIBS_FILES} ${install_slibdir}
595        ${MKINSTALLDIRS} ${install_slibdir}/gftables
596        cp ${GFTABLES} ${install_slibdir}/gftables
597        ${MKINSTALLDIRS} ${install_slibdir}/surfex
598        cp LIB/surfex/surfex.jar ${install_slibdir}/surfex
599        chmod -R +rX ${install_slibdir}/*
600
601tar:
602        tar cf Singular-${SINGULAR_VERSION}-src.tar ${DISTFILES}
603        gzip -f Singular-${SINGULAR_VERSION}-src.tar
604
605backup: tar
606        mcopy -o Singular-${SINGULAR_VERSION}-src.tar.gz a:
607
608TAGS:   ${SOURCES} ${ESOURCES} ${HEADERS}
609        etags ${SOURCES} ${ESOURCES} ${HEADERS} ../kernel/*.[ch] ../kernel/*.cc ../kernel/*.inc
610
611
612tags:   
613        ctags *.y *.[lch] *.cc *.inc ../kernel/*.[ch] ../kernel/*.cc ../kernel/*.inc
614
615echoLIBS:
616        @echo ${SLIBS}
617
618##
619## Below here is stuff for developpers
620#################################################################
621
622
623##
624## .og files for having -O and -g object versions available at the same time
625##
626
627OBJG1 := $(CXXSOURCES:.cc=.og)
628OBJG2 := $(CSOURCES:.c=.og)
629
630OBJG=$(OBJG1) $(OBJG2)
631
632DL_TAILG=\"sog\"
633
634
635ifeq ($(DL_KERNEL),1)
636
637OBJG := $(OBJG) $(DL_KERNEL_SOURCES:.cc=.og)
638DL_LIBSG := $(MPSR_SO:%.so=%.sog) $(DBMSR_SO:%.so=%.sog)
639
640else
641
642OBJG := $(OBJG) $(STATIC_SOURCES:.cc=.og) $(COMMON_SOURCES:.cc=.og)
643DL_LIBSG=
644
645endif
646
647
648##
649## compiler and linker options for debug version
650##
651
652CCG             = ${CC}
653CXXG            = ${CXX}
654CXXM            = gcc -MM -MG -DGENERATE_DEPEND
655CCM             = gcc -MM -MG -DGENERATE_DEPEND
656
657CFLAGSG         = -g -Wall -Wno-unused ${PIPE}
658CXXFLAGSG       = -g -Wall -Wno-unused ${PIPE}
659CXXTEMPLFLAGSG  = -fno-implicit-templates
660DEFSG           = -D@SING_UNAME@ @DEFS@ -DDL_TAIL=$(DL_TAILG)
661
662##
663## Debug Targets
664##
665
666%.dl_og: %.cc
667        ${CXXG} ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} ${SFLAGS} -c $< -o $@
668
669mpsr.sog: $(MPSR_SOURCES:.cc=.dl_og)
670        ${CXXG} ${CXXFLAGSG} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS} ${GLIBC_DYN_FIX}
671
672dbmsr.sog: $(DBMSR_SOURCES:.cc=.dl_og)
673        ${CXXG} ${CXXFLAGSG} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS}
674
675claptmpl.og: claptmpl.cc mod2.h
676        $(CXXG)  ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
677
678%.og: %.cc
679        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
680
681$(OBJG2) : %.og: %.c
682        $(CCG)  ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
683
684Singularg${S_EXT}: scanner.cc  $(OBJG)  $(DL_LIBSG)\
685           iparith.og mpsr_Tok.og claptmpl.og tesths.cc version.h
686        (cd ../kernel;make libkernel_g.a;make install;cd ../Singular)
687        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -o Singularg${S_EXT} \
688        tesths.cc iparith.og mpsr_Tok.og claptmpl.og $(OBJG) ${LDFLAGSG} ${LIBSG} -lomalloc ../kernel/mmalloc.og \
689        ${LD_DYN_FLAGS} ${LD_LIBC}
690
691iparith.og: iparith.inc iparith.cc
692        $(CXXG)  ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c iparith.cc -o iparith.og
693
694mpsr_Tok.og: iparith.inc mpsr_Tok.cc
695        $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${CXXTEMPLFLAGSG} ${DEFSG} -c mpsr_Tok.cc -o mpsr_Tok.og
696
697installg: Singularg
698        ${MKINSTALLDIRS} ${bindir}
699        ${INSTALL_PROGRAM} Singularg ${bindir} 
700
701ESingularg: mod2.h feOpt.cc version.h emacs.cc \
702           feOptES.inc
703        ${CXXG} ${CXXFLAGSG} ${CPPFLAGS} -DESINGULAR -g ${DEFSG} -o ESingularg emacs.cc ../kernel/fegetopt.og ${LDFLAGS} ${LIBS} -lomalloc ../kernel/mmalloc.og
704
705##
706## .op files for having -O and -g pg object versions available at the same time
707##
708
709OBJP1 := $(CXXSOURCES:.cc=.op)
710OBJP2 := $(CSOURCES:.c=.op)
711
712OBJP=$(OBJP1) $(OBJP2)
713
714DL_TAILP=\"sop\"
715
716
717ifeq ($(DL_KERNEL),1)
718
719OBJP := $(OBJP) $(DL_KERNEL_SOURCES:.cc=.op)
720DL_LIBSP := $(MPSR_SO:%.so=%.sop) $(DBMSR_SO:%.so=%.sop)
721
722else
723
724OBJP := $(OBJP) $(STATIC_SOURCES:.cc=.op) $(COMMON_SOURCES:.cc=.op)
725DL_LIBSP=
726
727endif
728
729
730##
731## compiler and linker options for profiling version
732##
733
734CCP             = ${CC}
735CXXP            = ${CXX}
736
737CFLAGSP         = -g -pg -O -Wall -Wno-unused ${PIPE}
738CXXFLAGSG       = -g -pg -O -Wall -Wno-unused ${PIPE}
739CXXTEMPLFLAGSP  = -fno-implicit-templates
740DEFSP           = -D@SING_UNAME@ @DEFS@ -DDL_TAIL=$(DL_TAILP)
741
742##
743## Profiling Targets
744##
745
746%.dl_op: %.cc
747        ${CXXP} ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} ${SFLAGS} -c $< -o $@
748
749mpsr.sop: $(MPSR_SOURCES:.cc=.dl_op)
750        ${CXXP} ${CXXFLAGSP} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS} ${GLIBC_DYN_FIX}
751
752dbmsr.sop: $(DBMSR_SOURCES:.cc=.dl_op)
753        ${CXXP} ${CXXFLAGSP} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS}
754
755claptmpl.op: claptmpl.cc mod2.h
756        $(CXXP)  ${CXXFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@
757
758%.op: %.cc
759        $(CXXP) ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@
760
761$(OBJP2) : %.op: %.c
762        $(CCP)  ${CFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@
763
764Singularp${S_EXT}: scanner.cc  $(OBJP)  $(DL_LIBSP)\
765           iparith.op mpsr_Tok.op claptmpl.op tesths.cc version.h
766        (cd ../kernel;make libkernel_p.a;make install;cd ../Singular)
767        $(CXXP) ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} -o Singularp${S_EXT} \
768        tesths.cc iparith.op mpsr_Tok.op claptmpl.op $(OBJP) ${LDFLAGSP} ${LIBSP} -lomalloc_p ../kernel/mmalloc.op \
769        ${LD_DYN_FLAGS} ${LD_LIBC}
770
771iparith.op: iparith.inc iparith.cc
772        $(CXXP)  ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} -c iparith.cc -o iparith.op
773
774mpsr_Tok.op: iparith.inc mpsr_Tok.cc
775        $(CXXP) ${CXXFLAGSP} ${CPPFLAGS} ${CXXTEMPLFLAGSP} ${DEFSP} -c mpsr_Tok.cc -o mpsr_Tok.op
776
777installp: Singularp
778        ${MKINSTALLDIRS} ${bindir}
779        ${INSTALL_PROGRAM} Singularp ${bindir} 
780
781##
782## dependencies
783##
784
785%.dd: %.cc mod2.h
786        echo $(@:.dd=.og) $(@:.dd=.op) $(@:.dd=.dl_o) $(@:.dd=.dl_og)  $(@:.dd=.dl_op)" " \\ > $@
787        $(CXXM) -DGENTABLE ${CPPFLAGS} ${DEFSG} $< >> $@
788
789%.d: %.c mod2.h
790        echo $(@:.d=.og) $(@:.d=.op)" " \\ > $@
791        $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@
792
793depend:   $(CXXSOURCES:.cc=.dd) $(ESOURCES:.cc=.dd) $(CSOURCES:.c=.d) mod2.h claptmpl.dd
794        -cat *.dd >>depend
795
796ifeq (depend,$(wildcard depend))
797include depend
798endif
799
800
Note: See TracBrowser for help on using the repository browser.