source: git/Singular/Makefile.in @ 1d81b2

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