source: git/Singular/Makefile.in @ cb25d3e

spielwiese
Last change on this file since cb25d3e was cb25d3e, checked in by Hans Schönemann <hannes@…>, 20 years ago
*hannes: moved more files to kernel git-svn-id: file:///usr/local/Singular/svn/trunk@6951 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 18.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@
16##
17## various paths
18##
19srcdir          = @srcdir@
20prefix          = @prefix@
21exec_prefix     = @exec_prefix@
22libdir          = @libdir@
23# program executable goes here
24bindir          = @bindir@
25# includes are taken from here
26includedir      = @includedir@
27slibdir         = ${prefix}/LIB
28install_bindir  = ${install_prefix}/${SINGUNAME}
29install_bindir_plural  = ${install_prefix}/Plural
30install_slibdir = ${install_prefix}/LIB
31
32##
33## various programs
34##
35@SET_MAKE@
36CC              = @CC@
37LD              = @LD@
38CXX             = @CXX@
39LEX             = @LEX@
40PERL            = @PERL@
41BISON           = bison
42INSTALL         = @INSTALL@
43INSTALL_PROGRAM = @INSTALL_PROGRAM@
44INSTALL_DATA    = @INSTALL_DATA@
45MKINSTALLDIRS   = ./mkinstalldirs
46LN_S            = @LN_S@
47
48##
49## compiler and linker options
50##
51PIPE            = @PIPE@
52CFLAGS          = @CFLAGS@ ${PIPE}
53CXXFLAGS        = @CXXFLAGS@ ${PIPE}
54CXXTEMPLFLAGS   = @CXXTEMPLFLAGS@
55CPPFLAGS        = -I${srcdir} -I../kernel @CPPFLAGS@
56DEFS            = -DNDEBUG -DOM_NDEBUG -D@SING_UNAME@ @DEFS@
57LDFLAGS         = -L../kernel -lkernel @LDFLAGS@
58LDFLAGSG        = -L../kernel -lkernel-g @LDFLAGS@
59LD_DYN_FLAGS    = @LD_DYN_FLAGS@
60SFLAGS          = @SFLAGS@
61SLDFLAGS        = @SLDFLAGS@
62
63LD_LIBC         = -lc
64STATIC_LDFLAGS  = @STATIC_LDFLAGS@
65# under cygwin, do not explicitly link against -lm, for it is the cygwin
66# lib -- if you really want to do this, use -lm as the _last_ thing on the
67# arguments to link
68ifneq ($(SINGUNAME),ix86-Win)
69LIBS            = -lm @NEED_LIBS@
70else
71LIBS            = -lsingfac -lsingcf -lntl -lgmp -static -lgdbm -lreadline -lncurses
72endif
73MP_LIBS         = @MP_LIBS@
74DL_KERNEL       = @DL_KERNEL@
75HAVE_MPSR       = @HAVE_MPSR@
76
77ifdef LD_STATIC
78LDFLAGS  := ${STATIC_LDFLAGS} ${LDFLAGS}
79SING_EXEC = Singular-static
80LIBS := ${MP_LIBS} ${LIBS}
81DL_KERNEL =
82else
83LDFLAGS  := ${LD_DYN_FLAGS} ${LDFLAGS}
84SING_EXEC = Singular
85endif
86
87# CXXFLAGS =  -g -Wall -Wno-unused
88# CFLAGS =  -g -Wall -Wno-unused
89##
90## End configuration dependend stuff
91#################################################################
92
93###
94### file sets
95###
96
97# normal C++ source files
98CXXSOURCES=grammar.cc scanner.cc attrib.cc \
99    eigenval.cc\
100    extra.cc fehelp.cc feResource.cc feOpt.cc \
101    ipassign.cc ipconv.cc ipid.cc iplib.cc \
102    ipprint.cc ipshell.cc \
103    lists.cc \
104    sdb.cc \
105    fglm.cc \
106    p_polys.cc \
107    silink.cc \
108    subexpr.cc \
109    janet.cc wrapper.cc\
110    libparse.cc sing_win.cc\
111    gms.cc pcv.cc maps_ip.cc\
112    pDebug.cc pInline2.cc pInline1.cc pInline0.cc \
113    pShallowCopyDelete.cc fast_maps.cc cntrlc.cc misc.cc
114
115# stuff for MP
116MPSR_SOURCES = mpsr_Put.cc mpsr_PutPoly.cc mpsr_GetPoly.cc mpsr_sl.cc\
117        mpsr_Get.cc mpsr_GetMisc.cc mpsr_Error.cc \
118
119
120# stuff for dbm
121DBMSR_SOURCES =  ndbm.cc sing_dbm.cc
122
123# normal C source files
124CSOURCES=dError.c
125
126# C++ sources which are used if part of the kernel are dynamically linked
127DL_KERNEL_SOURCES=slInit_Dynamic.cc
128
129# C++ sources which are used for dynamic libraries if part of the kernel is
130# dynamically linked
131DL_LIB_SOURCES=
132
133# C++ sources which are used if no parts of the kernel are dynamically linked
134STATIC_SOURCES=slInit_Static.cc
135
136# C++ sources for which both, shared and static object files are needed
137COMMON_SOURCES = $(MPSR_SOURCES) $(DBMSR_SOURCES)
138
139# special C++ source files (need extra compiling and/or linking), for which
140# dependencies should be generated
141ESOURCES=mmalloc.cc iparith.cc $(COMMON_SOURCES) \
142        $(DL_KERNEL_SOURCES) $(DL_LIB_SOURCES) $(STATIC_SOURCES)
143
144SOURCES=${CSOURCES} ${CXXSOURCES} \
145        grammar.y scanner.l libparse.l prCopyTemplate.cc \
146        p_Delete__T.cc p_ShallowCopyDelete__T.cc \
147        p_Copy__T.cc p_Mult_nn__T.cc  pp_Mult_nn__T.cc \
148        pp_Mult_mm__T.cc p_Mult_mm__T.cc \
149        p_Minus_mm_Mult_qq__T.cc p_Add_q__T.cc \
150        p_Neg__T.cc pp_Mult_Coeff_mm_DivSelect__T.cc \
151        pp_Mult_Coeff_mm_DivSelectMult__T.cc \
152        p_Merge_q__T.cc pp_Mult_mm_Noether__T.cc\
153        p_kBucketSetLm__T.cc \
154        kInline.cc utils.cc utils.h \
155        tesths.cc mpsr_Tok.cc claptmpl.cc
156
157HEADERS=lists.h attrib.h \
158        mpsr_Tok.h \
159        ipconv.h \
160        subexpr.h ipid.h \
161        cntrlc.h ipprint.h sdb.h dError.h \
162        ipshell.h tok.h \
163        fast_maps.h \
164        silink.h \
165        fglm.h sing_dbm.h \
166        mpsr.h mpsr_sl.h\
167        mpsr_Get.h kmatrix.h janet.h\
168        mpsr_Put.h\
169        dbm_sl.h libparse.h \
170        gms.h pcv.h eigenval.h \
171        feOpt.h fegetopt.h distrib.h walk.h \
172        static.h\
173        omSingularConfig.h
174
175DISTFILES=${SOURCES} ${HEADERS} ${ESOURCES} \
176        Makefile.in configure.in configure \
177        mod2.h.in grammar.h testgh install-sh mkinstalldirs \
178        check_aso.pl prCopy.pl
179
180OBJS := $(CXXSOURCES:.cc=.o) $(CSOURCES:.c=.o)
181
182ifeq ($(SINGUNAME),ix86-Win)
183OBJS := $(OBJS) Singular_res.o
184endif
185
186P_PROCS_MODULES = FieldZp FieldIndep FieldQ FieldGeneral
187
188ifeq ($(DL_KERNEL),1)
189OBJS    := $(OBJS) $(DL_KERNEL_SOURCES:.cc=.o)
190DBMSR_SO= dbmsr.so
191DL_LIBS := $(DBMSR_SO)
192ifeq ($(HAVE_MPSR), 1)
193MPSR_SO =       mpsr.so
194DL_LIBS :=      $(DL_LIBS) $(MPSR_SO)
195endif
196else
197ifndef LD_STATIC
198LIBS := $(MP_LIBS) $(LIBS)
199endif
200OBJS := $(OBJS) $(STATIC_SOURCES:.cc=.o) $(COMMON_SOURCES:.cc=.o)
201DL_LIBS=
202endif
203
204#
205# Singular libraries which go into distribution
206# MAKE SURE THAT THIS IS UP_TO_DATE
207#
208
209SLIBS = COPYING \
210        ainvar.lib   algebra.lib   all.lib       brnoeth.lib    classify.lib \
211        deform.lib   elim.lib      equising.lib  finvar.lib     gmssing.lib \
212        general.lib  graphics.lib  hnoether.lib  homolog.lib    inout.lib \
213        intprog.lib  latex.lib     linalg.lib    makedbm.lib    matrix.lib \
214        mprimdec.lib \
215        mondromy.lib mregular.lib  normal.lib    ntsolve.lib    paramet.lib \
216        poly.lib     presolve.lib  primdec.lib   primitiv.lib   qhmoduli.lib \
217        random.lib   reesclos.lib  ring.lib      rinvar.lib     sing.lib \
218        solve.lib    spcurve.lib   spectrum.lib  standard.lib   stratify.lib \
219        surf.lib     toric.lib     triang.lib    zeroset.lib    help.cnf
220
221PLIBS = lieA.lib
222
223SLIBS_FILES = $(addprefix LIB/,${SLIBS})
224
225PLIBS_FILES = $(addprefix LIB/,${PLIBS})
226
227GFTABLES = $(wildcard LIB/gftables/[1-9]*)
228
229##
230## Build Targets
231##
232.l.cc:
233        @if test "x${LEX}" = x; then \
234                echo Error: no lex given, could not rebuilt scanner.cc;\
235                exit 1; \
236        fi
237        ${LEX} -s -I -t $< > scanner.cc
238.y.cc:
239        @if test "x${BISON}" = x; then \
240                echo Error: no bison given, could not rebuilt grammar.cc;\
241                exit 1; \
242        fi
243        ${BISON} -d -t -o grammar.cc $<
244        chmod +x testgh
245        ./testgh
246
247.cc.o: 
248        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} -c $<
249.c.o:
250        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $<
251
252all:    $(SING_EXEC)
253
254Singular-static: version.h
255        sleep 1
256        echo "#define HAVE_STATIC" > static.h
257        ${MAKE} LD_STATIC=1 S_EXT="-static" Singular-static
258        echo "#undef HAVE_STATIC" > static.h
259
260Singular${S_EXT}: mod2.h Makefile version.h scanner.cc  ${OBJS} mmalloc.o \
261          iparith.o tesths.cc libparse.cc claptmpl.o mpsr_Tok.o $(DL_LIBS)
262        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} \
263          -o Singular${S_EXT} \
264          tesths.cc iparith.o mpsr_Tok.o claptmpl.o\
265          ${OBJS} ${LDFLAGS} ${LIBS} -lomalloc_ndebug mmalloc.o
266
267%.static: version.h
268        ${MAKE} DL_KERNEL=0 S_EXT=".static" $@
269
270iparith.o mpsr_Tok.o : iparith.inc mpsr_Tok.inc
271
272cntrlc.o cntrlc.og : feOptES.inc feOptTS.inc feOpt.inc
273
274claptmpl.o: claptmpl.cc mod2.h
275        ${CXX} ${CXXFLAGS}  ${CPPFLAGS} ${DEFS} -c $<   
276
277iparith.inc mpsr_Tok.inc: claptmpl.o iparith.cc mmalloc.o\
278                          ipconv.cc tok.h mpsr_Tok.cc grammar.h mod2.h
279        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} -DGENTABLE \
280             -o gentable claptmpl.o iparith.cc tesths.cc mpsr_Tok.cc \
281             ${OBJS} ${LDFLAGS} ${LIBS} -lomalloc_ndebug mmalloc.o
282        ./gentable
283        /bin/rm -f gentable gentable.exe
284
285
286version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in \
287           configure.in
288        echo "#define feVersionId "  `date '+%Y%m%d%H'` >version.h
289
290libparse: libparse_main.o utils.o fegetopt.o febase.cc
291        ${CXX}  -DSTANDALONE_PARSER -o libparse febase.cc libparse_main.o utils.o fegetopt.o
292
293libparse_main.o: libparse.cc
294        ${CXX} -c -o libparse_main.o libparse.cc  -DSTANDALONE_PARSER
295
296libparse.cc: libparse.l
297        @if test "x${LEX}" = x; then \
298                echo Error: no lex given, could not rebuilt libparse.cc;\
299                exit 1; \
300        fi
301        ${LEX} -I -Pyylp -olibparse.cc libparse.l
302
303# Hmm compiling with -fomit-frame-pointer resulted in access violation
304# under cygwin
305ESingular: fegetopt.o feResource.cc mod2.h feOpt.cc version.h emacs.cc \
306           feOptES.inc mmalloc.o
307        ${CXX} -O2 ${CPPFLAGS} ${DEFS} -DESINGULAR -o ESingular emacs.cc fegetopt.o \
308        ${LDFLAGS} -lomalloc_ndebug mmalloc.o
309
310TSingular: fegetopt.o feResource.cc mod2.h feOpt.cc version.h emacs.cc \
311           feOptTS.inc mmalloc.o
312        ${CXX} -O2 ${CPPFLAGS} ${DEFS} -DTSINGULAR -o TSingular emacs.cc fegetopt.o \
313        ${LDFLAGS} -lomalloc_ndebug mmalloc.o
314
315feOpt.o: feOpt.inc feOptES.inc feOptTS.inc
316extra.o: feOpt.inc
317
318feOpt.inc: feOpt.cc mod2.h feOpt.h
319        $(CXX) -DGENERATE_OPTION_INDEX feOpt.cc -o feOpt
320        ./feOpt
321        /bin/rm -f feOpt feOpt.exe
322
323feOptES.inc: feOpt.cc mod2.h feOpt.h
324        $(CXX) -DGENERATE_OPTION_INDEX  -DESINGULAR feOpt.cc -o feOpt
325        ./feOpt
326        rm -f feOpt feOpt.exe
327
328feOptTS.inc: feOpt.cc mod2.h feOpt.h
329        $(CXX) -DGENERATE_OPTION_INDEX  -DTSINGULAR feOpt.cc -o feOpt
330        ./feOpt
331        rm -f feOpt feOpt.exe
332
333mpsr.so: $(MPSR_SOURCES:.cc=.dl_o)
334        $(LD) ${SLDFLAGS} -o $@ $^ -L${libdir} ${MP_LIBS}
335
336dbmsr.so: $(DBMSR_SOURCES:.cc=.dl_o)
337        $(LD) ${SLDFLAGS} -o $@ $^
338
339src: scanner.cc grammar.h grammar.cc libparse.cc
340
341mod2.h: stamp-h
342
343stamp-h : config.status mod2.h.in
344        CONFIG_FILES= CONFIG_HEADERS="mod2.h" ./config.status
345
346Makefile: Makefile.in config.status
347        CONFIG_FILES="Makefile" CONFIG_HEADERS= ./config.status
348
349config.status: configure
350        ./config.status --recheck
351
352configure: configure.in
353        @echo "WARNING: You need to rerun autoconf. I am proceeding, for now."
354        @touch configure
355#       autoconf
356
357ifeq ($(SINGUNAME),ix86-Win)
358##
359## windows only targets
360##
361
362## resources
363Singular.rc: Singular.rc.in config.status
364        CONFIG_FILES="Singular.rc" CONFIG_HEADERS= ./config.status
365
366ESingular_res.o: Singular.rc
367        windres -DESINGULAR -i Singular.rc -o ESingular_res.o
368
369TSingular_res.o: Singular.rc
370        windres -DTSINGULAR -i Singular.rc -o TSingular_res.o
371
372Singular_res.o: Singular.rc
373        windres -DSINGULAR -i Singular.rc -o Singular_res.o
374
375## run
376run.o: run.c run.h
377        gcc -c -I. -O2 run.c -o run.o
378
379runTSingular : run.o TSingular_res.o
380        gcc -mwindows -e _mainCRTStartup run.o TSingular_res.o -o runTSingular.exe
381
382runESingular : run.o ESingular_res.o
383        gcc -mwindows -e _mainCRTStartup run.o ESingular_res.o -o runESingular.exe
384
385RUN_SINGULARS=runESingular runTSingular
386
387endif
388
389##
390## install targets
391##
392install: all installbin installslib
393
394installbin: ${SING_EXEC} libparse ESingular TSingular ${RUN_SINGULARS}
395        ${MKINSTALLDIRS} ${bindir}
396        ${INSTALL_PROGRAM} ${SING_EXEC} ${SINGULAR}
397        ${INSTALL_PROGRAM} libparse ${RUN_SINGULARS} ${bindir}
398        ${INSTALL_PROGRAM} ESingular TSingular ${DL_LIBS} ${bindir}
399        chmod a+x ${SINGULAR}
400        rm -f ${bindir}/${SING_EXEC}${EXEC_EXT}
401        cd ${bindir}; ${LN_S} ${SINGULAR} Singular${EXEC_EXT};
402
403installslib: LIB
404        test -r ${slibdir} || ${LN_S} `pwd`/LIB ${slibdir}
405
406
407uninstall: uninstallbin
408
409uninstallbin:
410        rm -f ${bindir}/Singular${EXEC_EXT}
411        rm -f ${SINGULAR}
412        -rmdir ${bindir}
413
414##
415## clean targest
416##
417mostlyclean:
418        -rm -f Singular Singular-static Singulara Singularg Singularp Singularb libparse feOpt*.inc
419        -rm -f *.o *.og core *.op *.ob *.ot Singulart *.od *_d.cc *_d.c  *.so*
420        -rm -f ESingular* TSingular*
421
422clean: mostlyclean
423        -rm -f *.bak *.d *.dd depend
424        -rm -f ${slibdir}
425
426distclean: clean
427        -rm -f iparith.inc mpsr_Tok.inc stamp.h
428        -rm -f Singular* *.gprof *.bprof *~ .\#* version.h
429        -rm -f mod2.h Makefile TAGS* tags config.status config.cache config.log
430
431srcclean:
432        @echo "This command is intended for maintainers to use;"
433        @echo "Rebuilding the deleted files requires flex"
434        @echo "bison, perl"
435        -rm -f scanner.cc grammar.h grammar.cc libparse.cc
436
437maintainer-clean: distclean srcclean
438        @echo "This command is intended for maintainers to use;"
439        @echo "Rebuilding the deleted files requires flex"
440        @echo "bison, perl and autoconf"
441        -rm configure
442
443##
444## miscellanous targets
445##
446
447install-bindist: $(HEADERS) $(SOURCES) Makefile depend
448        echo "#define MAKE_DISTRIBUTION " > distrib.h
449        sleep 1
450        ${MAKE} ${SING_EXEC} ESingular TSingular libparse ${RUN_SINGULARS}
451        ${MKINSTALLDIRS} ${install_bindir}
452        ${INSTALL_PROGRAM} -s  ${SING_EXEC} ${install_bindir}/Singular
453        ${INSTALL_PROGRAM} -s  libparse ${RUN_SINGULARS} ESingular TSingular ${DL_LIBS} ${install_bindir}
454        echo "#undef MAKE_DISTRIBUTION " > distrib.h
455
456install-bindist-plural: $(HEADERS) $(SOURCES) Makefile depend
457        echo "#define MAKE_DISTRIBUTION " > distrib.h
458        sleep 1
459        ${MAKE} ${SING_EXEC} ESingular TSingular libparse ${RUN_SINGULARS}
460        ${MKINSTALLDIRS} ${install_bindir}
461        ${INSTALL_PROGRAM} -s  ${SING_EXEC} ${install_bindir}/Plural
462        ${INSTALL_PROGRAM} -s  ESingular ${install_bindir}/EPlural
463        ${INSTALL_PROGRAM} -s  TSingular ${install_bindir}/TPlural
464        - ${INSTALL_PROGRAM} -s  runESingular ${install_bindir}/runEPlural
465        - ${INSTALL_PROGRAM} -s  runTSingular ${install_bindir}/runTPlural
466        ${INSTALL_PROGRAM} -s  libparse ${DL_LIBS} ${install_bindir}
467        echo "#undef MAKE_DISTRIBUTION " > distrib.h
468
469install-sharedist: ${SLIBS_FILES} LIB/gftables
470        ${MKINSTALLDIRS} ${install_slibdir}
471        cp ${SLIBS_FILES} ${install_slibdir}
472        ${MKINSTALLDIRS} ${install_slibdir}/gftables
473        cp ${GFTABLES} ${install_slibdir}/gftables
474        chmod -R +rX ${install_slibdir}/*
475
476install-sharedist-plural: ${PLIBS_FILES} install-sharedist
477        ${MKINSTALLDIRS} ${install_slibdir}
478        cp ${PLIBS_FILES} ${install_slibdir}
479        chmod -R +rX ${install_slibdir}/*
480
481tar:
482        tar cf Singular-${SINGULAR_VERSION}-src.tar ${DISTFILES}
483        gzip -f Singular-${SINGULAR_VERSION}-src.tar
484
485backup: tar
486        mcopy -o Singular-${SINGULAR_VERSION}-src.tar.gz a:
487
488TAGS:   ${SOURCES} ${ESOURCES} ${HEADERS}
489        etags ${SOURCES} ${ESOURCES} ${HEADERS}
490
491tags:   
492        ctags *.y *.l *.c *.h *.cc *.inc
493
494echoLIBS:
495        @echo ${SLIBS}
496
497##
498## Below here is stuff for developpers
499#################################################################
500
501
502##
503## .og files for having -O and -g object versions available at the same time
504##
505
506OBJG1 := $(CXXSOURCES:.cc=.og)
507OBJG2 := $(CSOURCES:.c=.og)
508
509OBJP1 := $(CXXSOURCES:.cc=.op)
510OBJP2 := $(CSOURCES:.c=.op)
511
512OBJB1 := $(CXXSOURCES:.cc=.ob)
513OBJB2 := $(CSOURCES:.c=.ob)
514
515OBJT1 := $(CXXSOURCES:.cc=.ot)
516OBJT2 := $(CSOURCES:.c=.ot)
517
518OBJA1 := $(CXXSOURCES:.cc=.oa)
519OBJA2 := $(CSOURCES:.c=.oa)
520
521
522OBJG=$(OBJG1) $(OBJG2)
523OBJP=$(OBJP1) $(OBJP2)
524OBJB=$(OBJB1) $(OBJB2)
525OBJT=$(OBJT1) $(OBJT2)
526OBJA=$(OBJA1) $(OBJA2)
527
528DL_TAILG=\"sog\"
529DL_TAILP=\"sop\"
530DL_TAILB=\"sob\"
531DL_TAILT=\"sot\"
532DL_TAILA=\"soa\"
533
534
535ifeq ($(DL_KERNEL),1)
536
537OBJG := $(OBJG) $(DL_KERNEL_SOURCES:.cc=.og)
538DL_LIBSG := $(MPSR_SO:%.so=%.sog) $(DBMSR_SO:%.so=%.sog)
539
540OBJP := $(OBJP) $(DL_KERNEL_SOURCES:.cc=.op)
541DL_LIBSP := $(MPSR_SO:%.so=%.sop) $(DBMSR_SO:%.so=%.sop)
542
543OBJB := $(OBJB) $(DL_KERNEL_SOURCES:.cc=.ob)
544DL_LIBSB := $(MPSR_SO:%.so=%.sob) $(DBMSR_SO:%.so=%.sob)
545
546OBJT := $(OBJT) $(DL_KERNEL_SOURCES:.cc=.ot)
547DL_LIBST := $(MPSR_SO:%.so=%.sot) $(DBMSR_SO:%.so=%.sot)
548
549OBJA := $(OBJA) $(DL_KERNEL_SOURCES:.cc=.oa)
550DL_LIBSA := $(MPSR_SO:%.so=%.soa) $(DBMSR_SO:%.so=%.soa)
551
552else
553
554OBJG := $(OBJG) $(STATIC_SOURCES:.cc=.og) $(COMMON_SOURCES:.cc=.og)
555DL_LIBSG=
556
557OBJP := $(OBJP) $(STATIC_SOURCES:.cc=.op) $(COMMON_SOURCES:.cc=.op)
558DL_LIBSP=
559
560OBJB := $(OBJB) $(STATIC_SOURCES:.cc=.ob) $(COMMON_SOURCES:.cc=.ob)
561DL_LIBSB=
562
563OBJT := $(OBJT) $(STATIC_SOURCES:.cc=.ot) $(COMMON_SOURCES:.cc=.ot)
564DL_LIBST=
565
566OBJA := $(OBJA) $(STATIC_SOURCES:.cc=.oa) $(COMMON_SOURCES:.cc=.oa)
567DL_LIBST=
568
569endif
570
571
572##
573## compiler and linker options for debug version
574##
575
576CCG             = gcc
577CXXG            = @CXX@
578CXXM            = gcc -MM -MG -DGENERATE_DEPEND
579CCM             = gcc -MM -MG -DGENERATE_DEPEND
580
581CFLAGSG         = -g -Wall -Wno-unused ${PIPE}
582CXXFLAGSG       = -g -Wall -Wno-unused ${PIPE}
583CXXTEMPLFLAGSG  = -fno-implicit-templates
584DEFSG           = -D@SING_UNAME@ @DEFS@ -DDL_TAIL=$(DL_TAILG)
585
586##
587## Debug Targets
588##
589
590%.dl_og: %.cc
591        ${CXXG} ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} ${SFLAGS} -c $< -o $@
592
593mpsr.sog: $(MPSR_SOURCES:.cc=.dl_og)
594        ${CXXG} ${CXXFLAGSG} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS}
595
596dbmsr.sog: $(DBMSR_SOURCES:.cc=.dl_og)
597        ${CXXG} ${CXXFLAGSG} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS}
598
599claptmpl.og: claptmpl.cc mod2.h
600        $(CXXG)  ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
601
602%.og: %.cc
603        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
604
605$(OBJG2) : %.og: %.c
606        $(CCG)  ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
607
608Singularg${S_EXT}: scanner.cc  $(OBJG)  mmalloc.og $(DL_LIBSG)\
609           iparith.og mpsr_Tok.og claptmpl.og tesths.cc version.h
610        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -o Singularg${S_EXT} \
611        tesths.cc iparith.og mpsr_Tok.og claptmpl.og $(OBJG) ${LDFLAGSG} ${LIBS} -lomalloc mmalloc.og \
612        ${LD_DYN_FLAGS} ${LD_LIBC}
613
614iparith.og: iparith.inc iparith.cc
615        $(CXXG)  ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c iparith.cc -o iparith.og
616
617mpsr_Tok.og: iparith.inc mpsr_Tok.cc
618        $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${CXXTEMPLFLAGSG} ${DEFSG} -c mpsr_Tok.cc -o mpsr_Tok.og
619
620installg: Singularg
621        ${MKINSTALLDIRS} ${bindir}
622        ${INSTALL_PROGRAM} Singularg ${bindir} 
623
624ESingularg: fegetopt.og feResource.cc mod2.h feOpt.cc version.h emacs.cc \
625           feOptES.inc mmalloc.og
626        ${CXXG} ${CXXFLAGSG} ${CPPFLAGS} -DESINGULAR -g ${DEFSG} -o ESingularg emacs.cc fegetopt.og ${LDFLAGS} ${LIBS} -lomalloc mmalloc.og
627
628##
629## compiler and linker options for profile version
630##
631
632CCP             = gcc
633CXXP            = @CXX@
634
635CFLAGSP         = -pg -O3 ${PIPE}
636CXXFLAGSP       = -pg -O3 ${PIPE}
637CXXTEMPLFLAGSP  = -fno-implicit-templates
638DEFSP           = -DNDEBUG -DOM_NDEBUG -DDO_PROFILE -D@SING_UNAME@ @DEFS@ -DDL_TAIL=$(DL_TAILP)
639LDFLAGSP        = -static @LDFLAGS@
640
641CFLAGSB         = -g -O3 ${PIPE}
642CXXFLAGSB       = -g -O3 ${PIPE}
643CXXTEMPLFLAGSB  = -fno-implicit-templates
644DEFSB           = -D@SING_UNAME@ -DOM_NDEBUG -DNDEBUG @DEFS@ -DDL_TAIL=$(DL_TAILB)
645LDFLAGSB        = -static @LDFLAGS@
646
647# bprof object  file to link with
648BPROFOBJ        = /usr/local/lib/bmon.o
649
650DEFST           = -DNO_INLINE -DNDEBUG -D@SING_UNAME@ -DOM_TRACK=2 -DOM_CHECK=0 @DEFS@ -DDL_TAIL=$(DL_TAILT)
651LDFLAGST        = @LDFLAGS@
652CFLAGST         = -g  -O2 -w ${PIPE}
653CXXFLAGST       = -g  -O2 -w ${PIPE}
654
655##
656## op and ob files for gprof and bprof, ot for mtrack, oc for OMCHECK=1
657##
658
659
660##
661## check_aso
662##
663check_aso:
664        ${PERL} check_aso.pl $(SOURCES)
665##
666## dependencies
667##
668
669%.dd: %.cc mod2.h
670        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)" " \\ > $@
671        $(CXXM) -DGENTABLE ${CPPFLAGS} ${DEFSG} $< >> $@
672
673%.d: %.c mod2.h
674        echo $(@:.d=.og) $(@:.d=.od) $(@:.dd=_d.c) $(@:.d=.op) $(@:.d=.ob) $(@:.d=.ot) $(@:.d=.oa)" " \\ > $@
675        $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@
676
677depend:   $(CXXSOURCES:.cc=.dd) $(ESOURCES:.cc=.dd) $(CSOURCES:.c=.d) mod2.h claptmpl.dd
678        cat *.d *.dd >depend
679
680ifeq (depend,$(wildcard depend))
681include depend
682endif
683
684
Note: See TracBrowser for help on using the repository browser.