source: git/Singular/Makefile.in @ a9cdc2

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