source: git/Singular/Makefile.in @ aa3877a

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