source: git/Singular/Makefile.in @ 492402

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