source: git/Singular/Makefile.in @ e6de331

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