source: git/Singular/Makefile.in @ 551494

spielwiese
Last change on this file since 551494 was 551494, checked in by Hans Schönemann <hannes@…>, 16 years ago
*hannes: GLIBC_DYN_FIX git-svn-id: file:///usr/local/Singular/svn/trunk@10559 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 19.9 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
175# stuff for MP
176MPSR_SOURCES = mpsr_Put.cc mpsr_PutPoly.cc mpsr_GetPoly.cc mpsr_sl.cc\
177        mpsr_Get.cc mpsr_GetMisc.cc mpsr_Error.cc \
178
179
180# stuff for dbm
181DBMSR_SOURCES =  ndbm.cc sing_dbm.cc
182
183# normal C source files
184CSOURCES=
185
186# C++ sources which are used if part of the kernel are dynamically linked
187DL_KERNEL_SOURCES=slInit_Dynamic.cc
188
189# C++ sources which are used for dynamic libraries if part of the kernel is
190# dynamically linked
191DL_LIB_SOURCES=
192
193# C++ sources which are used if no parts of the kernel are dynamically linked
194STATIC_SOURCES=slInit_Static.cc
195
196# C++ sources for which both, shared and static object files are needed
197COMMON_SOURCES = $(MPSR_SOURCES) $(DBMSR_SOURCES)
198
199# special C++ source files (need extra compiling and/or linking), for which
200# dependencies should be generated
201ESOURCES=iparith.cc $(COMMON_SOURCES) \
202        $(DL_KERNEL_SOURCES) $(DL_LIB_SOURCES) $(STATIC_SOURCES)
203
204SOURCES=${CSOURCES} ${CXXSOURCES} \
205        grammar.y scanner.l libparse.l \
206        utils.cc utils.h \
207        tesths.cc mpsr_Tok.cc claptmpl.cc
208
209HEADERS=lists.h attrib.h \
210        mpsr_Tok.h \
211        ipconv.h \
212        subexpr.h ipid.h \
213        cntrlc.h ipprint.h sdb.h \
214        ipshell.h tok.h \
215        silink.h \
216        sing_dbm.h maps_ip.h interpolation.h \
217        mpsr.h mpsr_sl.h\
218        mpsr_Get.h janet.h\
219        mpsr_Put.h walk.h\
220        dbm_sl.h libparse.h \
221        gms.h pcv.h eigenval_ip.h \
222        distrib.h walk.h \
223        static.h \
224        omSingularConfig.h
225
226DISTFILES=${SOURCES} ${HEADERS} ${ESOURCES} \
227        Makefile.in configure.in configure \
228        mod2.h.in grammar.h testgh install-sh mkinstalldirs \
229        check_aso.pl
230
231OBJS := $(CXXSOURCES:.cc=.o) $(CSOURCES:.c=.o)
232
233ifeq ($(SINGUNAME),ix86-Win)
234OBJS := $(OBJS) Singular_res.o
235endif
236
237P_PROCS_MODULES = FieldZp FieldIndep FieldQ FieldGeneral
238
239ifeq ($(DL_KERNEL),1)
240OBJS    := $(OBJS) $(DL_KERNEL_SOURCES:.cc=.o)
241DBMSR_SO= dbmsr.so
242DL_LIBS := $(DBMSR_SO)
243ifeq ($(HAVE_MPSR), 1)
244MPSR_SO =       mpsr.so
245DL_LIBS :=      $(DL_LIBS) $(MPSR_SO)
246endif
247else
248ifndef LD_STATIC
249LIBS := $(MP_LIBS) $(LIBS)
250endif
251OBJS := $(OBJS) $(STATIC_SOURCES:.cc=.o) $(COMMON_SOURCES:.cc=.o)
252DL_LIBS=
253endif
254
255#
256# Singular libraries which go into distribution
257# MAKE SURE THAT THIS IS UP_TO_DATE
258#
259
260SLIB0 = absfact.lib  arcpoint.lib  atkins.lib    aksaka.lib    ainvar.lib\
261        alexpoly.lib algebra.lib   brnoeth.lib   curvepar.lib  classify.lib \
262        compregb.lib \
263        control.lib  curvepar.lib   crypto.lib    deform.lib    elim.lib \
264        equising.lib \
265        finvar.lib   gmspoly.lib   gmssing.lib   general.lib   graphics.lib \
266        grwalk.lib   groups.lib    hnoether.lib  homolog.lib   hyperel.lib \
267        inout.lib    intprog.lib   kskernel.lib  latex.lib     linalg.lib \
268        lll.lib      makedbm.lib   matrix.lib \
269        modstd.lib   mondromy.lib  mprimdec.lib  mregular.lib  rootsmr.lib \
270        noether.lib  normal.lib    ntsolve.lib  \
271        poly.lib     presolve.lib  primdec.lib   primitiv.lib   qhmoduli.lib \
272        random.lib   realrad.lib   reesclos.lib  resolve.lib    resgraph.lib \
273        reszeta.lib \
274        ring.lib     rinvar.lib    sagbi.lib     sheafcoh.lib   sing.lib \
275        solve.lib    signcond.lib  spcurve.lib   spectrum.lib   standard.lib \
276        stratify.lib surf.lib      surfex.lib    teachstd.lib   toric.lib \
277        triang.lib   rootsur.lib  weierstr.lib  zeroset.lib
278 
279
280PLIBS = central.lib dmod.lib gkdim.lib involut.lib ncalg.lib ncdecomp.lib nctools.lib perron.lib qmatrix.lib
281
282ifdef HAVE_PLURAL
283SLIBS = COPYING ${SLIB0} ${PLIBS} all.lib help.cnf
284else
285SLIBS = COPYING ${SLIB0} all.lib help.cnf
286endif
287
288SLIBS_FILES = $(addprefix LIB/,${SLIBS})
289
290GFTABLES = $(wildcard LIB/gftables/[1-9]*)
291
292##
293## Build Targets
294##
295.l.cc:
296        @if test -r scanner.cc; then \
297                touch scanner.cc ;\
298        else \
299        if test "x${LEX}" = x; then \
300                echo Error: no lex given, could not rebuilt scanner.cc;\
301                exit 1; \
302        fi
303        ${LEX} -s -I -t $< > scanner.cc.lmp
304        cp scanner.cc.lmp scanner.cc
305
306.y.cc:
307        @if test -r grammar.cc; then \
308                touch grammar.cc ;\
309        else \
310        if test "x${BISON}" = x; then \
311                echo Error: no bison given, could not rebuilt grammar.cc;\
312                exit 1; \
313        fi;\
314        ${BISON} -d -t -o grammar.cc $<;\
315        chmod +x testgh;\
316        ./testgh;\
317        fi
318
319.cc.o: 
320        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} -c $<
321.c.o:
322        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $<
323
324%.dl_o : %.cc
325        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} ${SFLAGS} -c $< -o $@
326
327all:    $(SING_EXEC)
328
329Singular-static: version.h
330        sleep 1
331        echo "#define HAVE_STATIC" > static.h
332        (cd ../kernel;${MAKE} LD_STATIC=1 install-bindist;cd ..//Singular)
333        ${MAKE} LD_STATIC=1 S_EXT="-static" Singular-static
334        echo "#undef HAVE_STATIC" > static.h
335
336Singular${S_EXT}: mod2.h Makefile version.h $(WIN_LIBS) scanner.cc  ${OBJS} \
337          iparith.o tesths.cc libparse.cc claptmpl.o mpsr_Tok.o $(DL_LIBS)
338        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} \
339          -o Singular${S_EXT} \
340          tesths.cc iparith.o mpsr_Tok.o claptmpl.o\
341          ${OBJS} ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o
342
343libsingular: mod2.h Makefile version.h $(WIN_LIBS) scanner.cc  ${OBJS} \
344         iparith.o libsingular-tesths.o libparse.cc claptmpl.o mpsr_Tok.o $(DL_LIBS)
345        $(LIBSINGULAR_LD) ${SLDFLAGS} ${LIBSINGULAR_FLAGS} -o libsingular.${SO_SUFFIX} \
346        libsingular-tesths.o iparith.o mpsr_Tok.o claptmpl.o \
347        ${OBJS} -lkernel -L../kernel -L../factory -L../libfac -L${libdir} ${LIBSINGULAR_LIBS}
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 ${DL_LIBS} ${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}  $$file ${slibdir}; \
523        done
524        ${MKINSTALLDIRS} ${slibdir}/gftables
525        ${INSTALL} `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-bindist-plural: install-bindist
590
591install-sharedist-plural: install-sharedist
592
593install-sharedist: ${SLIBS_FILES} LIB/gftables
594        ${MKINSTALLDIRS} ${install_slibdir}
595        cp ${SLIBS_FILES} ${install_slibdir}
596        ${MKINSTALLDIRS} ${install_slibdir}/gftables
597        cp ${GFTABLES} ${install_slibdir}/gftables
598        ${MKINSTALLDIRS} ${install_slibdir}/surfex
599        cp -r LIB/surfex ${install_slibdir}
600        chmod -R +rX ${install_slibdir}/*
601
602tar:
603        tar cf Singular-${SINGULAR_VERSION}-src.tar ${DISTFILES}
604        gzip -f Singular-${SINGULAR_VERSION}-src.tar
605
606backup: tar
607        mcopy -o Singular-${SINGULAR_VERSION}-src.tar.gz a:
608
609TAGS:   ${SOURCES} ${ESOURCES} ${HEADERS}
610        etags ${SOURCES} ${ESOURCES} ${HEADERS} ../kernel/*.[ch] ../kernel/*.cc ../kernel/*.inc
611
612
613tags:   
614        ctags *.y *.[lch] *.cc *.inc ../kernel/*.[ch] ../kernel/*.cc ../kernel/*.inc
615
616echoLIBS:
617        @echo ${SLIBS}
618
619##
620## Below here is stuff for developpers
621#################################################################
622
623
624##
625## .og files for having -O and -g object versions available at the same time
626##
627
628OBJG1 := $(CXXSOURCES:.cc=.og)
629OBJG2 := $(CSOURCES:.c=.og)
630
631OBJG=$(OBJG1) $(OBJG2)
632
633DL_TAILG=\"sog\"
634
635
636ifeq ($(DL_KERNEL),1)
637
638OBJG := $(OBJG) $(DL_KERNEL_SOURCES:.cc=.og)
639DL_LIBSG := $(MPSR_SO:%.so=%.sog) $(DBMSR_SO:%.so=%.sog)
640
641else
642
643OBJG := $(OBJG) $(STATIC_SOURCES:.cc=.og) $(COMMON_SOURCES:.cc=.og)
644DL_LIBSG=
645
646endif
647
648
649##
650## compiler and linker options for debug version
651##
652
653CCG             = ${CC}
654CXXG            = ${CXX}
655CXXM            = gcc -MM -MG -DGENERATE_DEPEND
656CCM             = gcc -MM -MG -DGENERATE_DEPEND
657
658CFLAGSG         = -g -Wall -Wno-unused ${PIPE}
659CXXFLAGSG       = -g -Wall -Wno-unused ${PIPE}
660CXXTEMPLFLAGSG  = -fno-implicit-templates
661DEFSG           = -D@SING_UNAME@ @DEFS@ -DDL_TAIL=$(DL_TAILG)
662
663##
664## Debug Targets
665##
666
667%.dl_og: %.cc
668        ${CXXG} ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} ${SFLAGS} -c $< -o $@
669
670mpsr.sog: $(MPSR_SOURCES:.cc=.dl_og)
671        ${CXXG} ${CXXFLAGSG} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS} ${GLIBC_DYN_FIX}
672
673dbmsr.sog: $(DBMSR_SOURCES:.cc=.dl_og)
674        ${CXXG} ${CXXFLAGSG} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS}
675
676claptmpl.og: claptmpl.cc mod2.h
677        $(CXXG)  ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
678
679%.og: %.cc
680        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
681
682$(OBJG2) : %.og: %.c
683        $(CCG)  ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
684
685Singularg${S_EXT}: scanner.cc  $(OBJG)  $(DL_LIBSG)\
686           iparith.og mpsr_Tok.og claptmpl.og tesths.cc version.h
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## dependencies
707##
708
709%.dd: %.cc mod2.h
710        echo $(@:.dd=.og) $(@:.dd=_d.cc) $(@:.dd=.dl_o) $(@:.dd=.dl_og)" " \\ > $@
711        $(CXXM) -DGENTABLE ${CPPFLAGS} ${DEFSG} $< >> $@
712
713%.d: %.c mod2.h
714        echo $(@:.d=.og) $(@:.dd=_d.c)" " \\ > $@
715        $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@
716
717depend:   $(CXXSOURCES:.cc=.dd) $(ESOURCES:.cc=.dd) $(CSOURCES:.c=.d) mod2.h claptmpl.dd
718        -cat *.dd >>depend
719
720ifeq (depend,$(wildcard depend))
721include depend
722endif
723
724
Note: See TracBrowser for help on using the repository browser.