source: git/Singular/Makefile.in @ 0bfdff

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