source: git/Singular/Makefile.in @ d4f80c

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