source: git/Singular/Makefile.in @ ba2047

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