source: git/Singular/Makefile.in @ 9144cc1

spielwiese
Last change on this file since 9144cc1 was 9144cc1, checked in by Viktor Levandovskyy <levandov@…>, 20 years ago
*levandov: control lib added to SLIBS git-svn-id: file:///usr/local/Singular/svn/trunk@7583 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 18.2 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             = @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_ip.cc\
100    extra.cc fehelp.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    tgb.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_ip.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
209SLIB0 = COPYING \
210        ainvar.lib   alexpoly.lib  algebra.lib   all.lib       brnoeth.lib \
211        classify.lib control.lib \
212        deform.lib   elim.lib      equising.lib  finvar.lib    gmspoly.lib \
213        gmssing.lib \
214        general.lib  graphics.lib  groups.lib    hnoether.lib  homolog.lib  \
215        inout.lib \
216        intprog.lib  latex.lib     linalg.lib    makedbm.lib    matrix.lib \
217        mprimdec.lib \
218        mondromy.lib mregular.lib  normal.lib    ntsolve.lib    paramet.lib \
219        poly.lib     presolve.lib  primdec.lib   primitiv.lib   qhmoduli.lib \
220        random.lib   reesclos.lib  ring.lib      rinvar.lib     sing.lib \
221        solve.lib    spcurve.lib   spectrum.lib  standard.lib   stratify.lib \
222        surf.lib     toric.lib     triang.lib    zeroset.lib    help.cnf
223 
224
225PLIBS = center.lib ncall.lib ncalg.lib ncdecomp.lib nctools.lib gkdim.lib qmatrix.lib
226
227ifdef HAVE_PLURAL
228SLIBS = ${SLIB0} ${PLIBS}
229else
230SLIBS = ${SLIB0}
231endif
232
233SLIBS_FILES = $(addprefix LIB/,${SLIBS})
234
235GFTABLES = $(wildcard LIB/gftables/[1-9]*)
236
237##
238## Build Targets
239##
240.l.cc:
241        @if test "x${LEX}" = x; then \
242                echo Error: no lex given, could not rebuilt scanner.cc;\
243                exit 1; \
244        fi
245        ${LEX} -s -I -t $< > scanner.cc
246.y.cc:
247        @if test "x${BISON}" = x; then \
248                echo Error: no bison given, could not rebuilt grammar.cc;\
249                exit 1; \
250        fi
251        ${BISON} -d -t -o grammar.cc $<
252        chmod +x testgh
253        ./testgh
254
255.cc.o: 
256        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} -c $<
257.c.o:
258        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $<
259
260%.dl_o : %.cc
261        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} ${SFLAGS} -c $< -o $@
262
263all:    $(SING_EXEC)
264
265Singular-static: version.h
266        sleep 1
267        echo "#define HAVE_STATIC" > static.h
268        (cd ../kernel;${MAKE} LD_STATIC=1 install-bindist;cd ..//Singular)
269        ${MAKE} LD_STATIC=1 S_EXT="-static" Singular-static
270        echo "#undef HAVE_STATIC" > static.h
271
272Singular${S_EXT}: mod2.h Makefile version.h scanner.cc  ${OBJS} mmalloc.o \
273          iparith.o tesths.cc libparse.cc claptmpl.o mpsr_Tok.o $(DL_LIBS)
274        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} \
275          -o Singular${S_EXT} \
276          tesths.cc iparith.o mpsr_Tok.o claptmpl.o\
277          ${OBJS} ${LDFLAGS} ${LIBS} -lomalloc_ndebug mmalloc.o
278
279%.static: version.h
280        ${MAKE} DL_KERNEL=0 S_EXT=".static" $@
281
282iparith.o mpsr_Tok.o : iparith.inc mpsr_Tok.inc
283
284cntrlc.o cntrlc.og : feOptES.inc feOptTS.inc feOpt.inc
285
286claptmpl.o: claptmpl.cc mod2.h
287        ${CXX} ${CXXFLAGS}  ${CPPFLAGS} ${DEFS} -c $<   
288
289iparith.inc mpsr_Tok.inc: claptmpl.o iparith.cc mmalloc.o\
290                          ipconv.cc tok.h mpsr_Tok.cc grammar.h mod2.h
291        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} -DGENTABLE \
292             -o gentable claptmpl.o iparith.cc tesths.cc mpsr_Tok.cc \
293             ${OBJS} ${LDFLAGS} ${LIBS} -lomalloc_ndebug mmalloc.o
294        ./gentable
295        /bin/rm -f gentable gentable.exe
296
297
298version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in \
299           configure.in
300        echo "#define feVersionId "  `date '+%Y%m%d%H'` >version.h
301
302libparse: libparse_main.o utils.o fegetopt.o
303        ${CXX}  ${CPPFLAGS} -DSTANDALONE_PARSER -o libparse libparse_main.o utils.o fegetopt.o ${LDFLAGS} ${LIBS} -lomalloc_ndebug mmalloc.o
304
305libparse_main.o: libparse.cc
306        ${CXX} ${CPPFLAGS} -c -o libparse_main.o libparse.cc  -DSTANDALONE_PARSER
307
308libparse.cc: libparse.l
309        @if test "x${LEX}" = x; then \
310                echo Error: no lex given, could not rebuilt libparse.cc;\
311                exit 1; \
312        fi
313        ${LEX} -I -Pyylp -olibparse.cc libparse.l
314
315# Hmm compiling with -fomit-frame-pointer resulted in access violation
316# under cygwin
317ESingular: fegetopt.o mod2.h feOpt.cc version.h emacs.cc \
318           feOptES.inc mmalloc.o
319        ${CXX} -O2 ${CPPFLAGS} ${DEFS} -DESINGULAR -o ESingular emacs.cc fegetopt.o \
320        ${LDFLAGS} -lomalloc_ndebug mmalloc.o
321
322TSingular: fegetopt.o mod2.h feOpt.cc version.h emacs.cc \
323           feOptTS.inc mmalloc.o
324        ${CXX} -O2 ${CPPFLAGS} ${DEFS} -DTSINGULAR -o TSingular emacs.cc fegetopt.o \
325        ${LDFLAGS} -lomalloc_ndebug mmalloc.o
326
327feOpt.o: feOpt.inc feOptES.inc feOptTS.inc
328extra.o: feOpt.inc
329
330feOpt.inc: feOpt.cc mod2.h feOpt.h
331        $(CXX) -DGENERATE_OPTION_INDEX feOpt.cc -o feOpt
332        ./feOpt
333        /bin/rm -f feOpt feOpt.exe
334
335feOptES.inc: feOpt.cc mod2.h feOpt.h
336        $(CXX) -DGENERATE_OPTION_INDEX  -DESINGULAR feOpt.cc -o feOpt
337        ./feOpt
338        rm -f feOpt feOpt.exe
339
340feOptTS.inc: feOpt.cc mod2.h feOpt.h
341        $(CXX) -DGENERATE_OPTION_INDEX  -DTSINGULAR feOpt.cc -o feOpt
342        ./feOpt
343        rm -f feOpt feOpt.exe
344
345mpsr.so: $(MPSR_SOURCES:.cc=.dl_o)
346        $(LD) ${SLDFLAGS} -o $@ $^ -L${libdir} ${MP_LIBS}
347
348dbmsr.so: $(DBMSR_SOURCES:.cc=.dl_o)
349        $(LD) ${SLDFLAGS} -o $@ $^
350
351src: scanner.cc grammar.h grammar.cc libparse.cc
352
353mod2.h: stamp-h
354
355stamp-h : config.status mod2.h.in
356        CONFIG_FILES= CONFIG_HEADERS="mod2.h" ./config.status
357
358Makefile: Makefile.in config.status
359        CONFIG_FILES="Makefile" CONFIG_HEADERS= ./config.status
360
361config.status: configure
362        ./config.status --recheck
363
364configure: configure.in
365        @echo "WARNING: You need to rerun autoconf. I am proceeding, for now."
366        @touch configure
367#       autoconf
368
369ifeq ($(SINGUNAME),ix86-Win)
370##
371## windows only targets
372##
373
374## resources
375Singular.rc: Singular.rc.in config.status
376        CONFIG_FILES="Singular.rc" CONFIG_HEADERS= ./config.status
377
378ESingular_res.o: Singular.rc
379        windres -DESINGULAR -i Singular.rc -o ESingular_res.o
380
381TSingular_res.o: Singular.rc
382        windres -DTSINGULAR -i Singular.rc -o TSingular_res.o
383
384Singular_res.o: Singular.rc
385        windres -DSINGULAR -i Singular.rc -o Singular_res.o
386
387## run
388run.o: run.c run.h
389        gcc -c -I. -O2 run.c -o run.o
390
391runTSingular : run.o TSingular_res.o
392        gcc -mwindows -e _mainCRTStartup run.o TSingular_res.o -o runTSingular.exe
393
394runESingular : run.o ESingular_res.o
395        gcc -mwindows -e _mainCRTStartup run.o ESingular_res.o -o runESingular.exe
396
397RUN_SINGULARS=runESingular runTSingular
398
399endif
400
401##
402## install targets
403##
404install: all installbin installslib
405
406installbin: ${SING_EXEC} libparse ESingular TSingular ${RUN_SINGULARS}
407        ${MKINSTALLDIRS} ${bindir}
408        ${INSTALL_PROGRAM} ${SING_EXEC} ${SINGULAR}
409        -${INSTALL_PROGRAM} *.so ${bindir}
410        ${INSTALL_PROGRAM} libparse ${RUN_SINGULARS} ${bindir}
411        ${INSTALL_PROGRAM} ESingular TSingular ${DL_LIBS} ${bindir}
412        chmod a+x ${SINGULAR}
413        rm -f ${bindir}/${SING_EXEC}${EXEC_EXT}
414        cd ${bindir}; ${LN_S} ${SINGULAR} Singular${EXEC_EXT};
415
416installslib: LIB
417        test -r ${slibdir} || ${LN_S} `pwd`/LIB ${slibdir}
418
419
420uninstall: uninstallbin
421
422uninstallbin:
423        rm -f ${bindir}/Singular${EXEC_EXT}
424        rm -f ${SINGULAR}
425        -rmdir ${bindir}
426
427##
428## clean targest
429##
430mostlyclean:
431        -rm -f Singular Singular-static Singulara Singularg Singularp Singularb libparse feOpt*.inc
432        -rm -f *.o *.og core *.op *.ob *.ot Singulart *.od *_d.cc *_d.c  *.so*
433        -rm -f ESingular* TSingular*
434
435clean: mostlyclean
436        -rm -f *.bak *.d *.dd depend
437        -rm -f ${slibdir}
438
439distclean: clean
440        -rm -f iparith.inc mpsr_Tok.inc stamp.h
441        -rm -f Singular* *.gprof *.bprof *~ .\#* version.h
442        -rm -f mod2.h Makefile TAGS* tags config.status config.cache config.log
443
444srcclean:
445        @echo "This command is intended for maintainers to use;"
446        @echo "Rebuilding the deleted files requires flex"
447        @echo "bison, perl"
448        -rm -f scanner.cc grammar.h grammar.cc libparse.cc
449
450maintainer-clean: distclean srcclean
451        @echo "This command is intended for maintainers to use;"
452        @echo "Rebuilding the deleted files requires flex"
453        @echo "bison, perl and autoconf"
454        -rm configure
455
456##
457## miscellanous targets
458##
459
460install-bindist: $(HEADERS) $(SOURCES) Makefile depend
461        echo "#define MAKE_DISTRIBUTION " > distrib.h
462        sleep 1
463        ${MAKE} ${SING_EXEC} ESingular TSingular libparse ${RUN_SINGULARS}
464        ${MKINSTALLDIRS} ${install_bindir}
465        ${INSTALL_PROGRAM} -s  ${SING_EXEC} ${install_bindir}/Singular
466        -${INSTALL_PROGRAM} *.so ${install_bindir}
467        ${INSTALL_PROGRAM} -s  libparse ${RUN_SINGULARS} ESingular TSingular ${DL_LIBS} ${install_bindir}
468        echo "#undef MAKE_DISTRIBUTION " > distrib.h
469
470install-sharedist: ${SLIBS_FILES} LIB/gftables
471        ${MKINSTALLDIRS} ${install_slibdir}
472        cp ${SLIBS_FILES} ${install_slibdir}
473        ${MKINSTALLDIRS} ${install_slibdir}/gftables
474        cp ${GFTABLES} ${install_slibdir}/gftables
475        chmod -R +rX ${install_slibdir}/*
476
477tar:
478        tar cf Singular-${SINGULAR_VERSION}-src.tar ${DISTFILES}
479        gzip -f Singular-${SINGULAR_VERSION}-src.tar
480
481backup: tar
482        mcopy -o Singular-${SINGULAR_VERSION}-src.tar.gz a:
483
484TAGS:   ${SOURCES} ${ESOURCES} ${HEADERS}
485        etags ${SOURCES} ${ESOURCES} ${HEADERS}
486
487tags:   
488        ctags *.y *.l *.c *.h *.cc *.inc
489
490echoLIBS:
491        @echo ${SLIBS}
492
493##
494## Below here is stuff for developpers
495#################################################################
496
497
498##
499## .og files for having -O and -g object versions available at the same time
500##
501
502OBJG1 := $(CXXSOURCES:.cc=.og)
503OBJG2 := $(CSOURCES:.c=.og)
504
505OBJP1 := $(CXXSOURCES:.cc=.op)
506OBJP2 := $(CSOURCES:.c=.op)
507
508OBJB1 := $(CXXSOURCES:.cc=.ob)
509OBJB2 := $(CSOURCES:.c=.ob)
510
511OBJT1 := $(CXXSOURCES:.cc=.ot)
512OBJT2 := $(CSOURCES:.c=.ot)
513
514OBJA1 := $(CXXSOURCES:.cc=.oa)
515OBJA2 := $(CSOURCES:.c=.oa)
516
517
518OBJG=$(OBJG1) $(OBJG2)
519OBJP=$(OBJP1) $(OBJP2)
520OBJB=$(OBJB1) $(OBJB2)
521OBJT=$(OBJT1) $(OBJT2)
522OBJA=$(OBJA1) $(OBJA2)
523
524DL_TAILG=\"sog\"
525DL_TAILP=\"sop\"
526DL_TAILB=\"sob\"
527DL_TAILT=\"sot\"
528DL_TAILA=\"soa\"
529
530
531ifeq ($(DL_KERNEL),1)
532
533OBJG := $(OBJG) $(DL_KERNEL_SOURCES:.cc=.og)
534DL_LIBSG := $(MPSR_SO:%.so=%.sog) $(DBMSR_SO:%.so=%.sog)
535
536OBJP := $(OBJP) $(DL_KERNEL_SOURCES:.cc=.op)
537DL_LIBSP := $(MPSR_SO:%.so=%.sop) $(DBMSR_SO:%.so=%.sop)
538
539OBJB := $(OBJB) $(DL_KERNEL_SOURCES:.cc=.ob)
540DL_LIBSB := $(MPSR_SO:%.so=%.sob) $(DBMSR_SO:%.so=%.sob)
541
542OBJT := $(OBJT) $(DL_KERNEL_SOURCES:.cc=.ot)
543DL_LIBST := $(MPSR_SO:%.so=%.sot) $(DBMSR_SO:%.so=%.sot)
544
545OBJA := $(OBJA) $(DL_KERNEL_SOURCES:.cc=.oa)
546DL_LIBSA := $(MPSR_SO:%.so=%.soa) $(DBMSR_SO:%.so=%.soa)
547
548else
549
550OBJG := $(OBJG) $(STATIC_SOURCES:.cc=.og) $(COMMON_SOURCES:.cc=.og)
551DL_LIBSG=
552
553OBJP := $(OBJP) $(STATIC_SOURCES:.cc=.op) $(COMMON_SOURCES:.cc=.op)
554DL_LIBSP=
555
556OBJB := $(OBJB) $(STATIC_SOURCES:.cc=.ob) $(COMMON_SOURCES:.cc=.ob)
557DL_LIBSB=
558
559OBJT := $(OBJT) $(STATIC_SOURCES:.cc=.ot) $(COMMON_SOURCES:.cc=.ot)
560DL_LIBST=
561
562OBJA := $(OBJA) $(STATIC_SOURCES:.cc=.oa) $(COMMON_SOURCES:.cc=.oa)
563DL_LIBST=
564
565endif
566
567
568##
569## compiler and linker options for debug version
570##
571
572CCG             = gcc
573CXXG            = @CXX@
574CXXM            = gcc -MM -MG -DGENERATE_DEPEND
575CCM             = gcc -MM -MG -DGENERATE_DEPEND
576
577CFLAGSG         = -g -Wall -Wno-unused ${PIPE}
578CXXFLAGSG       = -g -Wall -Wno-unused ${PIPE}
579CXXTEMPLFLAGSG  = -fno-implicit-templates
580DEFSG           = -D@SING_UNAME@ @DEFS@ -DDL_TAIL=$(DL_TAILG)
581
582##
583## Debug Targets
584##
585
586%.dl_og: %.cc
587        ${CXXG} ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} ${SFLAGS} -c $< -o $@
588
589mpsr.sog: $(MPSR_SOURCES:.cc=.dl_og)
590        ${CXXG} ${CXXFLAGSG} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS}
591
592dbmsr.sog: $(DBMSR_SOURCES:.cc=.dl_og)
593        ${CXXG} ${CXXFLAGSG} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS}
594
595claptmpl.og: claptmpl.cc mod2.h
596        $(CXXG)  ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
597
598%.og: %.cc
599        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
600
601$(OBJG2) : %.og: %.c
602        $(CCG)  ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
603
604Singularg${S_EXT}: scanner.cc  $(OBJG)  mmalloc.og $(DL_LIBSG)\
605           iparith.og mpsr_Tok.og claptmpl.og tesths.cc version.h
606        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -o Singularg${S_EXT} \
607        tesths.cc iparith.og mpsr_Tok.og claptmpl.og $(OBJG) ${LDFLAGSG} ${LIBS} -lomalloc mmalloc.og \
608        ${LD_DYN_FLAGS} ${LD_LIBC}
609
610iparith.og: iparith.inc iparith.cc
611        $(CXXG)  ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c iparith.cc -o iparith.og
612
613mpsr_Tok.og: iparith.inc mpsr_Tok.cc
614        $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${CXXTEMPLFLAGSG} ${DEFSG} -c mpsr_Tok.cc -o mpsr_Tok.og
615
616installg: Singularg
617        ${MKINSTALLDIRS} ${bindir}
618        ${INSTALL_PROGRAM} Singularg ${bindir} 
619
620ESingularg: fegetopt.og mod2.h feOpt.cc version.h emacs.cc \
621           feOptES.inc mmalloc.og
622        ${CXXG} ${CXXFLAGSG} ${CPPFLAGS} -DESINGULAR -g ${DEFSG} -o ESingularg emacs.cc fegetopt.og ${LDFLAGS} ${LIBS} -lomalloc mmalloc.og
623
624##
625## compiler and linker options for profile version
626##
627
628CCP             = gcc
629CXXP            = @CXX@
630
631CFLAGSP         = -pg -O3 ${PIPE}
632CXXFLAGSP       = -pg -O3 ${PIPE}
633CXXTEMPLFLAGSP  = -fno-implicit-templates
634DEFSP           = -DNDEBUG -DOM_NDEBUG -DDO_PROFILE -D@SING_UNAME@ @DEFS@ -DDL_TAIL=$(DL_TAILP)
635LDFLAGSP        = -static @LDFLAGS@
636
637CFLAGSB         = -g -O3 ${PIPE}
638CXXFLAGSB       = -g -O3 ${PIPE}
639CXXTEMPLFLAGSB  = -fno-implicit-templates
640DEFSB           = -D@SING_UNAME@ -DOM_NDEBUG -DNDEBUG @DEFS@ -DDL_TAIL=$(DL_TAILB)
641LDFLAGSB        = -static @LDFLAGS@
642
643# bprof object  file to link with
644BPROFOBJ        = /usr/local/lib/bmon.o
645
646DEFST           = -DNO_INLINE -DNDEBUG -D@SING_UNAME@ -DOM_TRACK=2 -DOM_CHECK=0 @DEFS@ -DDL_TAIL=$(DL_TAILT)
647LDFLAGST        = @LDFLAGS@
648CFLAGST         = -g  -O2 -w ${PIPE}
649CXXFLAGST       = -g  -O2 -w ${PIPE}
650
651##
652## op and ob files for gprof and bprof, ot for mtrack, oc for OMCHECK=1
653##
654
655
656##
657## check_aso
658##
659check_aso:
660        ${PERL} check_aso.pl $(SOURCES)
661##
662## dependencies
663##
664
665%.dd: %.cc mod2.h
666        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)" " \\ > $@
667        $(CXXM) -DGENTABLE ${CPPFLAGS} ${DEFSG} $< >> $@
668
669%.d: %.c mod2.h
670        echo $(@:.d=.og) $(@:.d=.od) $(@:.dd=_d.c) $(@:.d=.op) $(@:.d=.ob) $(@:.d=.ot) $(@:.d=.oa)" " \\ > $@
671        $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@
672
673depend:   $(CXXSOURCES:.cc=.dd) $(ESOURCES:.cc=.dd) $(CSOURCES:.c=.d) mod2.h claptmpl.dd
674        cat *.d *.dd >depend
675
676ifeq (depend,$(wildcard depend))
677include depend
678endif
679
680
Note: See TracBrowser for help on using the repository browser.