source: git/Singular/Makefile.in @ 6da18b

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