source: git/Singular/Makefile.in @ 7447d8

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