source: git/Singular/Makefile.in @ 2f5b71

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