source: git/Singular/Makefile.in @ b8148a

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