source: git/Singular/Makefile.in @ 666c90

spielwiese
Last change on this file since 666c90 was 666c90, checked in by Hans Schönemann <hannes@…>, 19 years ago
*hannes: prCopy ->kernel git-svn-id: file:///usr/local/Singular/svn/trunk@7856 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    p_polys.cc \
108    silink.cc \
109    subexpr.cc \
110    janet.cc wrapper.cc\
111    libparse.cc sing_win.cc\
112    gms.cc pcv.cc maps_ip.cc\
113    tgb.cc\
114    pShallowCopyDelete.cc cntrlc.cc misc.cc
115
116# stuff for MP
117MPSR_SOURCES = mpsr_Put.cc mpsr_PutPoly.cc mpsr_GetPoly.cc mpsr_sl.cc\
118        mpsr_Get.cc mpsr_GetMisc.cc mpsr_Error.cc \
119
120
121# stuff for dbm
122DBMSR_SOURCES =  ndbm.cc sing_dbm.cc
123
124# normal C source files
125CSOURCES=
126
127# C++ sources which are used if part of the kernel are dynamically linked
128DL_KERNEL_SOURCES=slInit_Dynamic.cc
129
130# C++ sources which are used for dynamic libraries if part of the kernel is
131# dynamically linked
132DL_LIB_SOURCES=
133
134# C++ sources which are used if no parts of the kernel are dynamically linked
135STATIC_SOURCES=slInit_Static.cc
136
137# C++ sources for which both, shared and static object files are needed
138COMMON_SOURCES = $(MPSR_SOURCES) $(DBMSR_SOURCES)
139
140# special C++ source files (need extra compiling and/or linking), for which
141# dependencies should be generated
142ESOURCES=mmalloc.cc iparith.cc $(COMMON_SOURCES) \
143        $(DL_KERNEL_SOURCES) $(DL_LIB_SOURCES) $(STATIC_SOURCES)
144
145SOURCES=${CSOURCES} ${CXXSOURCES} \
146        grammar.y scanner.l libparse.l \
147        p_Delete__T.cc p_ShallowCopyDelete__T.cc \
148        p_Copy__T.cc p_Mult_nn__T.cc  pp_Mult_nn__T.cc \
149        pp_Mult_mm__T.cc p_Mult_mm__T.cc \
150        p_Minus_mm_Mult_qq__T.cc p_Add_q__T.cc \
151        p_Neg__T.cc pp_Mult_Coeff_mm_DivSelect__T.cc \
152        pp_Mult_Coeff_mm_DivSelectMult__T.cc \
153        p_Merge_q__T.cc pp_Mult_mm_Noether__T.cc\
154        p_kBucketSetLm__T.cc \
155        kInline.cc utils.cc utils.h \
156        tesths.cc mpsr_Tok.cc claptmpl.cc
157
158HEADERS=lists.h attrib.h \
159        mpsr_Tok.h \
160        ipconv.h \
161        subexpr.h ipid.h \
162        cntrlc.h ipprint.h sdb.h \
163        ipshell.h tok.h \
164        silink.h \
165        fglm.h sing_dbm.h maps_ip.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
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    \
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 gkdim.lib involution.lib ncall.lib ncalg.lib ncdecomp.lib nctools.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.lmp
246        cp scanner.cc.lmp scanner.cc
247
248.y.cc:
249        @if test "x${BISON}" = x; then \
250                echo Error: no bison given, could not rebuilt grammar.cc;\
251                exit 1; \
252        fi
253        ${BISON} -d -t -o grammar.cc $<
254        chmod +x testgh
255        ./testgh
256
257.cc.o: 
258        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} -c $<
259.c.o:
260        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $<
261
262%.dl_o : %.cc
263        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} ${SFLAGS} -c $< -o $@
264
265all:    $(SING_EXEC)
266
267Singular-static: version.h
268        sleep 1
269        echo "#define HAVE_STATIC" > static.h
270        (cd ../kernel;${MAKE} LD_STATIC=1 install-bindist;cd ..//Singular)
271        ${MAKE} LD_STATIC=1 S_EXT="-static" Singular-static
272        echo "#undef HAVE_STATIC" > static.h
273
274Singular${S_EXT}: mod2.h Makefile version.h scanner.cc  ${OBJS} mmalloc.o \
275          iparith.o tesths.cc libparse.cc claptmpl.o mpsr_Tok.o $(DL_LIBS)
276        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} \
277          -o Singular${S_EXT} \
278          tesths.cc iparith.o mpsr_Tok.o claptmpl.o\
279          ${OBJS} ${LDFLAGS} ${LIBS} -lomalloc_ndebug mmalloc.o
280
281%.static: version.h
282        ${MAKE} DL_KERNEL=0 S_EXT=".static" $@
283
284iparith.o mpsr_Tok.o : iparith.inc mpsr_Tok.inc
285
286cntrlc.o cntrlc.og : feOptES.inc feOptTS.inc feOpt.inc
287
288claptmpl.o: claptmpl.cc mod2.h
289        ${CXX} ${CXXFLAGS}  ${CPPFLAGS} ${DEFS} -c $<   
290
291iparith.inc mpsr_Tok.inc: claptmpl.o iparith.cc mmalloc.o\
292                          ipconv.cc tok.h mpsr_Tok.cc grammar.h mod2.h
293        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} -DGENTABLE \
294             -o gentable claptmpl.o iparith.cc tesths.cc mpsr_Tok.cc \
295             ${OBJS} ${LDFLAGS} ${LIBS} -lomalloc_ndebug mmalloc.o
296        ./gentable
297        /bin/rm -f gentable gentable.exe
298
299
300version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in \
301           configure.in
302        echo "#define feVersionId "  `date '+%Y%m%d%H'` >version.h
303
304libparse: libparse_main.o utils.o fegetopt.o
305        ${CXX}  ${CPPFLAGS} -DSTANDALONE_PARSER -o libparse libparse_main.o utils.o fegetopt.o ${LDFLAGS2} -lomalloc_ndebug
306
307libparse_main.o: libparse.cc
308        ${CXX} ${CPPFLAGS} -c -o libparse_main.o libparse.cc  -DSTANDALONE_PARSER
309
310libparse.cc: libparse.l
311        @if test "x${LEX}" = x; then \
312                echo Error: no lex given, could not rebuilt libparse.cc;\
313                exit 1; \
314        fi
315        ${LEX} -I -Pyylp -t libparse.l >libparse.cc.lmp
316        cp libparse.cc.lmp libparse.cc
317
318# Hmm compiling with -fomit-frame-pointer resulted in access violation
319# under cygwin
320ESingular: fegetopt.o mod2.h feOpt.cc version.h emacs.cc \
321           feOptES.inc mmalloc.o
322        ${CXX} -O2 ${CPPFLAGS} ${DEFS} -DESINGULAR -o ESingular emacs.cc fegetopt.o \
323        ${LDFLAGS} -lomalloc_ndebug mmalloc.o
324
325TSingular: fegetopt.o mod2.h feOpt.cc version.h emacs.cc \
326           feOptTS.inc mmalloc.o
327        ${CXX} -O2 ${CPPFLAGS} ${DEFS} -DTSINGULAR -o TSingular emacs.cc fegetopt.o \
328        ${LDFLAGS} -lomalloc_ndebug mmalloc.o
329
330feOpt.o: feOpt.inc feOptES.inc feOptTS.inc
331extra.o: feOpt.inc
332
333feOpt.inc: feOpt.cc mod2.h feOpt.h
334        $(CXX) -DGENERATE_OPTION_INDEX feOpt.cc -o feOpt
335        ./feOpt
336        /bin/rm -f feOpt feOpt.exe
337
338feOptES.inc: feOpt.cc mod2.h feOpt.h
339        $(CXX) -DGENERATE_OPTION_INDEX  -DESINGULAR feOpt.cc -o feOpt
340        ./feOpt
341        rm -f feOpt feOpt.exe
342
343feOptTS.inc: feOpt.cc mod2.h feOpt.h
344        $(CXX) -DGENERATE_OPTION_INDEX  -DTSINGULAR feOpt.cc -o feOpt
345        ./feOpt
346        rm -f feOpt feOpt.exe
347
348mpsr.so: $(MPSR_SOURCES:.cc=.dl_o)
349        $(LD) ${SLDFLAGS} -o $@ $^ -L${libdir} ${MP_LIBS}
350
351dbmsr.so: $(DBMSR_SOURCES:.cc=.dl_o)
352        $(LD) ${SLDFLAGS} -o $@ $^
353
354src: scanner.cc grammar.h grammar.cc libparse.cc
355
356mod2.h: stamp-h
357
358stamp-h : config.status mod2.h.in
359        CONFIG_FILES= CONFIG_HEADERS="mod2.h" ./config.status
360
361Makefile: Makefile.in config.status
362        CONFIG_FILES="Makefile" CONFIG_HEADERS= ./config.status
363
364config.status: configure
365        ./config.status --recheck
366
367configure: configure.in
368        @echo "WARNING: You need to rerun autoconf. I am proceeding, for now."
369        @touch configure
370#       autoconf
371
372ifeq ($(SINGUNAME),ix86-Win)
373##
374## windows only targets
375##
376
377## resources
378Singular.rc: Singular.rc.in config.status
379        CONFIG_FILES="Singular.rc" CONFIG_HEADERS= ./config.status
380
381ESingular_res.o: Singular.rc
382        windres -DESINGULAR -i Singular.rc -o ESingular_res.o
383
384TSingular_res.o: Singular.rc
385        windres -DTSINGULAR -i Singular.rc -o TSingular_res.o
386
387Singular_res.o: Singular.rc
388        windres -DSINGULAR -i Singular.rc -o Singular_res.o
389
390## run
391run.o: run.c run.h
392        gcc -c -I. -O2 run.c -o run.o
393
394runTSingular : run.o TSingular_res.o
395        gcc -mwindows -e _mainCRTStartup run.o TSingular_res.o -o runTSingular.exe
396
397runESingular : run.o ESingular_res.o
398        gcc -mwindows -e _mainCRTStartup run.o ESingular_res.o -o runESingular.exe
399
400RUN_SINGULARS=runESingular runTSingular
401
402endif
403
404##
405## install targets
406##
407install: all installbin installslib
408
409installbin: ${SING_EXEC} libparse ESingular TSingular ${RUN_SINGULARS}
410        ${MKINSTALLDIRS} ${bindir}
411        ${INSTALL_PROGRAM} ${SING_EXEC} ${SINGULAR}
412        -${INSTALL_PROGRAM} *.so ${bindir}
413        ${INSTALL_PROGRAM} libparse ${RUN_SINGULARS} ${bindir}
414        ${INSTALL_PROGRAM} ESingular TSingular ${DL_LIBS} ${bindir}
415        chmod a+x ${SINGULAR}
416        rm -f ${bindir}/${SING_EXEC}${EXEC_EXT}
417        cd ${bindir}; ${LN_S} ${SINGULAR} Singular${EXEC_EXT};
418
419installslib: LIB
420        test -r ${slibdir} || ${LN_S} `pwd`/LIB ${slibdir}
421
422
423uninstall: uninstallbin
424
425uninstallbin:
426        rm -f ${bindir}/Singular${EXEC_EXT}
427        rm -f ${SINGULAR}
428        -rmdir ${bindir}
429
430##
431## clean targest
432##
433mostlyclean:
434        -rm -f Singular Singular-static Singulara Singularg Singularp Singularb libparse feOpt*.inc
435        -rm -f *.o *.og core *.op *.ob *.ot Singulart *.od *_d.cc *_d.c  *.so*
436        -rm -f ESingular* TSingular*
437
438clean: mostlyclean
439        -rm -f *.bak *.d *.dd depend
440        -rm -f ${slibdir}
441
442distclean: clean
443        -rm -f iparith.inc mpsr_Tok.inc stamp.h
444        -rm -f Singular* *.gprof *.bprof *~ .\#* version.h
445        -rm -f mod2.h Makefile TAGS* tags config.status config.cache config.log
446
447srcclean:
448        @echo "This command is intended for maintainers to use;"
449        @echo "Rebuilding the deleted files requires flex"
450        @echo "bison, perl"
451        -rm -f scanner.cc grammar.h grammar.cc libparse.cc
452
453maintainer-clean: distclean srcclean
454        @echo "This command is intended for maintainers to use;"
455        @echo "Rebuilding the deleted files requires flex"
456        @echo "bison, perl and autoconf"
457        -rm configure
458
459##
460## miscellanous targets
461##
462
463install-bindist: $(HEADERS) $(SOURCES) Makefile depend
464        echo "#define MAKE_DISTRIBUTION " > distrib.h
465        sleep 1
466        ${MAKE} ${SING_EXEC} ESingular TSingular libparse ${RUN_SINGULARS}
467        ${MKINSTALLDIRS} ${install_bindir}
468        ${INSTALL_PROGRAM} -s  ${SING_EXEC} ${install_bindir}/Singular
469        -${INSTALL_PROGRAM} *.so ${install_bindir}
470        ${INSTALL_PROGRAM} -s  libparse ${RUN_SINGULARS} ESingular TSingular ${DL_LIBS} ${install_bindir}
471        echo "#undef MAKE_DISTRIBUTION " > distrib.h
472
473install-bindist-plural: install-bindist
474
475install-sharedist-plural: install-sharedist
476
477install-sharedist: ${SLIBS_FILES} LIB/gftables
478        ${MKINSTALLDIRS} ${install_slibdir}
479        cp ${SLIBS_FILES} ${install_slibdir}
480        ${MKINSTALLDIRS} ${install_slibdir}/gftables
481        cp ${GFTABLES} ${install_slibdir}/gftables
482        chmod -R +rX ${install_slibdir}/*
483
484tar:
485        tar cf Singular-${SINGULAR_VERSION}-src.tar ${DISTFILES}
486        gzip -f Singular-${SINGULAR_VERSION}-src.tar
487
488backup: tar
489        mcopy -o Singular-${SINGULAR_VERSION}-src.tar.gz a:
490
491TAGS:   ${SOURCES} ${ESOURCES} ${HEADERS}
492        etags ${SOURCES} ${ESOURCES} ${HEADERS}
493
494tags:   
495        ctags *.y *.[lch] *.cc *.inc ../kernel/*.[ch] ../kernel/*.cc ../kernel/*.inc
496
497echoLIBS:
498        @echo ${SLIBS}
499
500##
501## Below here is stuff for developpers
502#################################################################
503
504
505##
506## .og files for having -O and -g object versions available at the same time
507##
508
509OBJG1 := $(CXXSOURCES:.cc=.og)
510OBJG2 := $(CSOURCES:.c=.og)
511
512OBJP1 := $(CXXSOURCES:.cc=.op)
513OBJP2 := $(CSOURCES:.c=.op)
514
515OBJB1 := $(CXXSOURCES:.cc=.ob)
516OBJB2 := $(CSOURCES:.c=.ob)
517
518OBJT1 := $(CXXSOURCES:.cc=.ot)
519OBJT2 := $(CSOURCES:.c=.ot)
520
521OBJA1 := $(CXXSOURCES:.cc=.oa)
522OBJA2 := $(CSOURCES:.c=.oa)
523
524
525OBJG=$(OBJG1) $(OBJG2)
526OBJP=$(OBJP1) $(OBJP2)
527OBJB=$(OBJB1) $(OBJB2)
528OBJT=$(OBJT1) $(OBJT2)
529OBJA=$(OBJA1) $(OBJA2)
530
531DL_TAILG=\"sog\"
532DL_TAILP=\"sop\"
533DL_TAILB=\"sob\"
534DL_TAILT=\"sot\"
535DL_TAILA=\"soa\"
536
537
538ifeq ($(DL_KERNEL),1)
539
540OBJG := $(OBJG) $(DL_KERNEL_SOURCES:.cc=.og)
541DL_LIBSG := $(MPSR_SO:%.so=%.sog) $(DBMSR_SO:%.so=%.sog)
542
543OBJP := $(OBJP) $(DL_KERNEL_SOURCES:.cc=.op)
544DL_LIBSP := $(MPSR_SO:%.so=%.sop) $(DBMSR_SO:%.so=%.sop)
545
546OBJB := $(OBJB) $(DL_KERNEL_SOURCES:.cc=.ob)
547DL_LIBSB := $(MPSR_SO:%.so=%.sob) $(DBMSR_SO:%.so=%.sob)
548
549OBJT := $(OBJT) $(DL_KERNEL_SOURCES:.cc=.ot)
550DL_LIBST := $(MPSR_SO:%.so=%.sot) $(DBMSR_SO:%.so=%.sot)
551
552OBJA := $(OBJA) $(DL_KERNEL_SOURCES:.cc=.oa)
553DL_LIBSA := $(MPSR_SO:%.so=%.soa) $(DBMSR_SO:%.so=%.soa)
554
555else
556
557OBJG := $(OBJG) $(STATIC_SOURCES:.cc=.og) $(COMMON_SOURCES:.cc=.og)
558DL_LIBSG=
559
560OBJP := $(OBJP) $(STATIC_SOURCES:.cc=.op) $(COMMON_SOURCES:.cc=.op)
561DL_LIBSP=
562
563OBJB := $(OBJB) $(STATIC_SOURCES:.cc=.ob) $(COMMON_SOURCES:.cc=.ob)
564DL_LIBSB=
565
566OBJT := $(OBJT) $(STATIC_SOURCES:.cc=.ot) $(COMMON_SOURCES:.cc=.ot)
567DL_LIBST=
568
569OBJA := $(OBJA) $(STATIC_SOURCES:.cc=.oa) $(COMMON_SOURCES:.cc=.oa)
570DL_LIBST=
571
572endif
573
574
575##
576## compiler and linker options for debug version
577##
578
579CCG             = gcc
580CXXG            = @CXX@
581CXXM            = gcc -MM -MG -DGENERATE_DEPEND
582CCM             = gcc -MM -MG -DGENERATE_DEPEND
583
584CFLAGSG         = -g -Wall -Wno-unused ${PIPE}
585CXXFLAGSG       = -g -Wall -Wno-unused ${PIPE}
586CXXTEMPLFLAGSG  = -fno-implicit-templates
587DEFSG           = -D@SING_UNAME@ @DEFS@ -DDL_TAIL=$(DL_TAILG)
588
589##
590## Debug Targets
591##
592
593%.dl_og: %.cc
594        ${CXXG} ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} ${SFLAGS} -c $< -o $@
595
596mpsr.sog: $(MPSR_SOURCES:.cc=.dl_og)
597        ${CXXG} ${CXXFLAGSG} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS}
598
599dbmsr.sog: $(DBMSR_SOURCES:.cc=.dl_og)
600        ${CXXG} ${CXXFLAGSG} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS}
601
602claptmpl.og: claptmpl.cc mod2.h
603        $(CXXG)  ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
604
605%.og: %.cc
606        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
607
608$(OBJG2) : %.og: %.c
609        $(CCG)  ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
610
611Singularg${S_EXT}: scanner.cc  $(OBJG)  mmalloc.og $(DL_LIBSG)\
612           iparith.og mpsr_Tok.og claptmpl.og tesths.cc version.h
613        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -o Singularg${S_EXT} \
614        tesths.cc iparith.og mpsr_Tok.og claptmpl.og $(OBJG) ${LDFLAGSG} ${LIBS} -lomalloc mmalloc.og \
615        ${LD_DYN_FLAGS} ${LD_LIBC}
616
617iparith.og: iparith.inc iparith.cc
618        $(CXXG)  ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c iparith.cc -o iparith.og
619
620mpsr_Tok.og: iparith.inc mpsr_Tok.cc
621        $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${CXXTEMPLFLAGSG} ${DEFSG} -c mpsr_Tok.cc -o mpsr_Tok.og
622
623installg: Singularg
624        ${MKINSTALLDIRS} ${bindir}
625        ${INSTALL_PROGRAM} Singularg ${bindir} 
626
627ESingularg: fegetopt.og mod2.h feOpt.cc version.h emacs.cc \
628           feOptES.inc mmalloc.og
629        ${CXXG} ${CXXFLAGSG} ${CPPFLAGS} -DESINGULAR -g ${DEFSG} -o ESingularg emacs.cc fegetopt.og ${LDFLAGS} ${LIBS} -lomalloc mmalloc.og
630
631##
632## compiler and linker options for profile version
633##
634
635CCP             = gcc
636CXXP            = @CXX@
637
638CFLAGSP         = -pg -O3 ${PIPE}
639CXXFLAGSP       = -pg -O3 ${PIPE}
640CXXTEMPLFLAGSP  = -fno-implicit-templates
641DEFSP           = -DNDEBUG -DOM_NDEBUG -DDO_PROFILE -D@SING_UNAME@ @DEFS@ -DDL_TAIL=$(DL_TAILP)
642LDFLAGSP        = -static @LDFLAGS@
643
644CFLAGSB         = -g -O3 ${PIPE}
645CXXFLAGSB       = -g -O3 ${PIPE}
646CXXTEMPLFLAGSB  = -fno-implicit-templates
647DEFSB           = -D@SING_UNAME@ -DOM_NDEBUG -DNDEBUG @DEFS@ -DDL_TAIL=$(DL_TAILB)
648LDFLAGSB        = -static @LDFLAGS@
649
650# bprof object  file to link with
651BPROFOBJ        = /usr/local/lib/bmon.o
652
653DEFST           = -DNO_INLINE -DNDEBUG -D@SING_UNAME@ -DOM_TRACK=2 -DOM_CHECK=0 @DEFS@ -DDL_TAIL=$(DL_TAILT)
654LDFLAGST        = @LDFLAGS@
655CFLAGST         = -g  -O2 -w ${PIPE}
656CXXFLAGST       = -g  -O2 -w ${PIPE}
657
658##
659## op and ob files for gprof and bprof, ot for mtrack, oc for OMCHECK=1
660##
661
662
663##
664## check_aso
665##
666check_aso:
667        ${PERL} check_aso.pl $(SOURCES)
668##
669## dependencies
670##
671
672%.dd: %.cc mod2.h
673        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)" " \\ > $@
674        $(CXXM) -DGENTABLE ${CPPFLAGS} ${DEFSG} $< >> $@
675
676%.d: %.c mod2.h
677        echo $(@:.d=.og) $(@:.d=.od) $(@:.dd=_d.c) $(@:.d=.op) $(@:.d=.ob) $(@:.d=.ot) $(@:.d=.oa)" " \\ > $@
678        $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@
679
680depend:   $(CXXSOURCES:.cc=.dd) $(ESOURCES:.cc=.dd) $(CSOURCES:.c=.d) mod2.h claptmpl.dd
681        -cat *.d >depend
682        -cat *.dd >>depend
683
684ifeq (depend,$(wildcard depend))
685include depend
686endif
687
688
Note: See TracBrowser for help on using the repository browser.