source: git/Singular/Makefile.in @ 02bfd57

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