source: git/Singular/Makefile.in @ 67fb84

spielwiese
Last change on this file since 67fb84 was 67fb84, checked in by Olaf Bachmann <obachman@…>, 24 years ago
* better sleep git-svn-id: file:///usr/local/Singular/svn/trunk@4423 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 18.1 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_slibdir = ${install_prefix}/LIB
30
31##
32## various programs
33##
34@SET_MAKE@
35CC              = @CC@
36CXX             = @CXX@
37LEX             = @LEX@
38PERL            = @PERL@
39BISON           = bison
40INSTALL         = @INSTALL@
41INSTALL_PROGRAM = @INSTALL_PROGRAM@
42INSTALL_DATA    = @INSTALL_DATA@
43MKINSTALLDIRS   = ./mkinstalldirs
44LN_S            = @LN_S@
45
46##
47## compiler and linker options
48##
49PIPE            = @PIPE@
50CFLAGS          = @CFLAGS@ ${PIPE}
51CXXFLAGS        = @CXXFLAGS@ ${PIPE}
52CXXTEMPLFLAGS   = @CXXTEMPLFLAGS@
53CPPFLAGS        = -I${srcdir} @CPPFLAGS@
54DEFS            = -DNDEBUG -D@SING_UNAME@ @DEFS@
55LDFLAGS         = @LDFLAGS@
56LD_DYN_FLAGS    = @LD_DYN_FLAGS@
57LD_LIBC         = -lc
58STATIC_LDFLAGS  = @STATIC_LDFLAGS@
59LIBS            = -lm @NEED_LIBS@
60
61ifdef LD_STATIC
62LDFLAGS  := ${STATIC_LDFLAGS} ${LDFLAGS}
63SING_EXEC = Singular-static
64else
65LDFLAGS  := ${LD_DYN_FLAGS} ${LDFLAGS}
66SING_EXEC = Singular
67endif
68
69
70##
71## End configuration dependend stuff
72#################################################################
73
74###
75### file sets
76###
77
78# normal C++ source files
79CXXSOURCES=grammar.cc scanner.cc algmap.cc attrib.cc binom.cc clapconv.cc \
80    clapmem.cc clapsing.cc cntrlc.cc\
81    extra.cc febase.cc feread.cc fehelp.cc feResource.cc feOpt.cc\
82    ffields.cc hdegree.cc hilb.cc hutil.cc \
83    ideals.cc intvec.cc \
84    ipassign.cc ipconv.cc ipid.cc iplib.cc \
85    ipprint.cc ipshell.cc khstd.cc kstdfac.cc \
86    kstd1.cc kstd2.cc kutil.cc lists.cc \
87    longalg.cc longrat.cc longrat0.cc \
88    maps.cc matpol.cc misc.cc sdb.cc gnumpfl.cc gnumpc.cc \
89    mminit.cc modulop.cc mpr_complex.cc sparsmat.cc \
90    fglm.cc fglmzero.cc fglmvec.cc fglmgauss.cc fglmhom.cc fglmcomb.cc \
91    numbers.cc polys.cc polys0.cc polys1.cc polys-impl.cc \
92    ring.cc shortfl.cc silink.cc sing_mp.cc\
93    sing_dld.cc sing_dbm.cc kspoly.cc \
94    subexpr.cc syz.cc syz0.cc syz1.cc syz2.cc syz3.cc\
95    timer.cc weight.cc \
96    mpsr_Put.cc mpsr_PutPoly.cc mpsr_GetPoly.cc \
97    mpsr_Get.cc mpsr_GetMisc.cc mpsr_Error.cc \
98    GMPrat.cc multicnt.cc npolygon.cc semic.cc spectrum.cc splist.cc \
99    ndbm.cc  libparse.cc mod_raw.cc\
100    pcv.cc kbuckets.cc prProcs.cc \
101    mpr_inout.cc mpr_base.cc mpr_numeric.cc \
102    prCopy.cc
103
104
105# normal C source files
106CSOURCES=mmalloc.c mmheap.c mmpage.c mmcheck.c  mmisc.c mmtables.c \
107    mmbt.c weight0.c find_exec.c fegetopt.c fereadl.c page.c feOpenWinntUrl.c
108
109# special source files (need extra compiling and/or linking)
110ESOURCES=iparith.cc gmalloc.c tesths.cc mpsr_Tok.cc claptmpl.cc
111
112SOURCES=${CSOURCES} ${CXXSOURCES} ${ESOURCES} \
113        grammar.y scanner.l libparse.l syz2.cc
114
115# ASO_SOURCES
116ASO_SOURCES = structs.aso.cc ipid.aso.cc mmprivate.aso.cc silink.aso.cc \
117              matpol.aso.cc longrat.aso.cc kbuckets.aso.cc mpsr_Get.aso.cc \
118              attrib.aso.cc lists.aso.cc\
119              syz.aso.cc subexpr.aso.cc
120
121HEADERS=algmap.h hutil.h lists.h stairc.h attrib.h ideals.h \
122        longalg.h mpsr_Tok.h structs.h binom.h intvec.h longrat.h \
123        numbers.h stype.h clapconv.h ipconv.h maps.h page.h \
124        subexpr.h clapsing.h ipid.h matpol.h polys.h syz.h \
125        cntrlc.h ipprint.h ring.h timer.h sdb.h \
126        febase.h ipshell.h shortfl.h tok.h mpr_complex.h mpr_global.h \
127        mmemory.h mmprivate.h mmpage.h page.h \
128        ffields.h khstd.h silink.h sparsmat.h gnumpfl.h gnumpc.h \
129        fglm.h kstd1.h modulop.h sing_dbm.h weight.h \
130        fglmgauss.h fglmvec.h mpsr.h sing_mp.h \
131        kstdfac.h mpsr_Get.h mmbt.h \
132        kutil.h mpsr_Put.h sing_dld.h\
133        ndbm.h polys-impl.h polys-comp.h libparse.h \
134        GMPrat.h multicnt.h npolygon.h semic.h spectrum.h splist.h multicnt.h \
135        pcv.h mod_raw.h kbuckets.h prProcs.h \
136        mpr_global.h mpr_inout.h mpr_base.h mpr_numeric.h \
137        feOpt.h fegetopt.h distrib.h walk.h \
138        prCopy.h
139
140INCS=febase.inc polys.inc iparith.inc mpsr_Tok.inc feOpt.inc
141
142DISTFILES=${SOURCES} ${HEADERS} Makefile.in configure.in configure \
143        mod2.h.in grammar.h testgh install-sh mkinstalldirs \
144        ${INCS} $(ASO_SOURCES) check_aso.pl aso.h
145
146OBJS := $(CXXSOURCES:.cc=.o) $(CSOURCES:.c=.o)
147
148ifeq ($(SINGUNAME),ix86-Win)
149OBJS := $(OBJS) Singular_res.o
150endif
151
152ASO_OBJS := $(ASO_SOURCES:.aso.cc=.aso)
153
154#
155# Singular libraries which go into distribution
156# MAKE SURE THAT THIS IS UP_TO_DATE
157#
158SLIBS = algebra.lib        all.lib            classify.lib       deform.lib  \
159        elim.lib           factor.lib         finvar.lib         general.lib \
160        graphics.lib       hnoether.lib       homolog.lib        inout.lib   \
161        ainvar.lib         jordan.lib         latex.lib          linalg.lib  \
162        matrix.lib         mondromy.lib       normal.lib                     \
163        poly.lib           presolve.lib       primdec.lib                    \
164        primitiv.lib       random.lib         ring.lib           sing.lib    \
165        solve.lib          solver.lib         spcurve.lib        standard.lib\
166        surf.lib           triang.lib         template.lib       spectrum.lib\
167        Mregular.lib       toric.lib          ip.lib
168
169SLIBS_FILES = $(addprefix LIB/,${SLIBS})
170
171GFTABLES = $(wildcard LIB/gftables/[1-9]*)
172
173##
174## Build Targets
175##
176.l.cc:
177        @if test "x${LEX}" = x; then \
178                echo Error: no lex given, could not rebuilt scanner.cc;\
179                exit 1; \
180        fi
181        ${LEX} -s -I -t $< > scanner.cc
182.y.cc:
183        @if test "x${BISON}" = x; then \
184                echo Error: no bison given, could not rebuilt grammar.cc;\
185                exit 1; \
186        fi
187        ${BISON} -d -t -o grammar.cc $<
188        chmod +x testgh
189        ./testgh
190
191.cc.o: 
192        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} -c $<
193.c.o:
194        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $<
195
196%.aso.o: %.aso.cc mmtables.inc
197        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} $< -o $@
198.PRECIOUS: %.aso.o
199
200%.aso: %.aso.o
201        ./$< > $@
202
203all:    $(SING_EXEC)
204
205Singular-static: mod2.h Makefile version.h scanner.cc gmalloc.o \
206          ${ASO_OBJS} ${OBJS} \
207          iparith.o tesths.cc libparse.cc claptmpl.o mpsr_Tok.o
208        sleep 1
209        echo "#define HAVE_STATIC" > static.h
210        ${MAKE} LD_STATIC=1 Singular
211        echo "#undef HABE_STATIC" > static.h
212        ${INSTALL_PROGRAM} Singular Singular-static
213
214Singular: mod2.h Makefile version.h scanner.cc gmalloc.o \
215          ${ASO_OBJS} ${OBJS} \
216          iparith.o tesths.cc libparse.cc claptmpl.o mpsr_Tok.o
217        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} \
218          -o Singular \
219          tesths.cc iparith.o mpsr_Tok.o claptmpl.o\
220          ${OBJS} ${LDFLAGS} ${LIBS} \
221          gmalloc.o ${LD_LIBC}
222
223iparith.o mpsr_Tok.o : iparith.inc mpsr_Tok.inc
224
225claptmpl.o: claptmpl.cc mod2.h
226        ${CXX} ${CXXFLAGS}  ${CPPFLAGS} ${DEFS} -c $<   
227
228iparith.inc mpsr_Tok.inc: gmalloc.o claptmpl.o iparith.cc \
229                          ipconv.cc tok.h mpsr_Tok.cc grammar.h mod2.h
230        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} -DGENTABLE \
231             -o gentable claptmpl.o iparith.cc tesths.cc mpsr_Tok.cc \
232             ${OBJS} ${LDFLAGS} ${LIBS} gmalloc.o ${LD_LIBC}
233        ./gentable
234        /bin/rm -f gentable gentable.exe
235
236
237mmtables.inc: mmtables.c mmprivate.h mmemory.h mod2.h
238        ${CC} ${CFLAGS}  ${CPPFLAGS}\
239               -DGENERATE_INDEX_TABLE  -DHAVE_ASO=0 -DHAVE_INDEX_TABLE mmtables.c -o mmtables
240        ./mmtables > mmtables.inc
241        rm -f mmtables mmtables.exe
242
243mmtables.o mmtables.d: mmtables.inc
244
245version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in \
246           configure.in
247        echo unsigned long feVersionId =  `date '+%Y%m%d%H'`\; >version.h
248
249libparse: libparse_main.o utils.o fegetopt.o febase.cc
250        ${CXX}  -DHAVE_ASO=0 -DSTANDALONE_PARSER -o libparse febase.cc libparse_main.o utils.o fegetopt.o
251
252libparse_main.o: libparse.cc
253        ${CXX} -c -o libparse_main.o libparse.cc  -DHAVE_ASO=0 -DSTANDALONE_PARSER
254
255libparse.cc: libparse.l
256        @if test "x${LEX}" = x; then \
257                echo Error: no lex given, could not rebuilt libparse.cc;\
258                exit 1; \
259        fi
260        ${LEX} -I -Pyylp -olibparse.cc libparse.l
261
262# Hmm compiling with -fomit-frame-pointer resulted in access violation
263# under cygwin
264ESingular: fegetopt.o feResource.cc mod2.h feOpt.cc version.h emacs.cc \
265           feOptES.inc
266        ${CXX} -O ${DEFS} -DESINGULAR -o ESingular emacs.cc fegetopt.o \
267        ${LDFLAGS} ${LIBS} ${LD_LIBC}
268
269TSingular: fegetopt.o feResource.cc mod2.h feOpt.cc version.h emacs.cc \
270           feOptTS.inc
271        ${CXX} -O ${DEFS} -DTSINGULAR -o TSingular emacs.cc fegetopt.o \
272        ${LDFLAGS} ${LIBS} ${LD_LIBC}
273
274feOpt.h: feOpt.inc feOptES.inc feOptTS.inc
275
276feOpt.inc: feOpt.cc mod2.h
277        $(CXX) -DGENERATE_OPTION_INDEX -DHAVE_ASO=0 feOpt.cc -o feOpt
278        ./feOpt
279        /bin/rm -f feOpt feOpt.exe
280
281feOptES.inc: feOpt.cc
282        $(CXX) -DGENERATE_OPTION_INDEX  -DHAVE_ASO=0 -DESINGULAR feOpt.cc -o feOpt
283        ./feOpt
284        rm -f feOpt feOpt.exe
285
286feOptTS.inc: feOpt.cc
287        $(CXX) -DGENERATE_OPTION_INDEX  -DHAVE_ASO=0 -DTSINGULAR feOpt.cc -o feOpt
288        ./feOpt
289        rm -f feOpt feOpt.exe
290
291prCopy.cc : prCopy.inc
292
293prCopy.inc : prCopyMacros.h prCopyTemplate.cc prCopy.pl
294        $(PERL) prCopy.pl > prCopy.inc
295
296src: scanner.cc grammar.h grammar.cc libparse.cc
297
298mod2.h: stamp-h
299
300stamp-h : config.status mod2.h.in
301        CONFIG_FILES= CONFIG_HEADERS="mod2.h" ./config.status
302
303Makefile: Makefile.in config.status
304        CONFIG_FILES="Makefile" CONFIG_HEADERS= ./config.status
305
306config.status: configure
307        ./config.status --recheck
308
309configure: configure.in
310        @echo "WARNING: You need to rerun autoconf. I am proceeding, for now."
311        @touch configure
312#       autoconf
313
314ifeq ($(SINGUNAME),ix86-Win)
315##
316## windows only targets
317##
318
319## resources
320Singular.rc: Singular.rc.in config.status
321        CONFIG_FILES="Singular.rc" CONFIG_HEADERS= ./config.status
322
323ESingular_res.o: Singular.rc
324        windres -DESINGULAR -i Singular.rc -o ESingular_res.o
325
326TSingular_res.o: Singular.rc
327        windres -DTSINGULAR -i Singular.rc -o TSingular_res.o
328
329Singular_res.o: Singular.rc
330        windres -DSINGULAR -i Singular.rc -o Singular_res.o
331
332## run
333run.o: run.c run.h
334        gcc -c -I. -O2 run.c -o run.o
335
336runTSingular : run.o TSingular_res.o
337        gcc -mwindows -e _mainCRTStartup run.o TSingular_res.o -o runTSingular.exe
338
339runESingular : run.o ESingular_res.o
340        gcc -mwindows -e _mainCRTStartup run.o ESingular_res.o -o runESingular.exe
341
342RUN_SINGULARS=runESingular runTSingular
343
344endif
345
346##
347## install targets
348##
349install: all installbin installslib
350
351installbin: ${SING_EXEC} libparse ESingular TSingular ${RUN_SINGULARS}
352        ${MKINSTALLDIRS} ${bindir}
353        ${INSTALL_PROGRAM} ${SING_EXEC} ${SINGULAR}
354        ${INSTALL_PROGRAM} libparse ${RUN_SINGULARS} ${bindir}
355        ${INSTALL_PROGRAM} ESingular ${bindir}
356        ${INSTALL_PROGRAM} TSingular ${bindir}
357        chmod a+x ${SINGULAR}
358        rm -f ${bindir}/${SING_EXEC}${EXEC_EXT}
359        cd ${bindir}; ${LN_S} ${SINGULAR} Singular${EXEC_EXT};\
360
361installslib: LIB
362        test -r ${slibdir} || ${LN_S} `pwd`/LIB ${slibdir}
363
364
365uninstall: uninstallbin
366
367uninstallbin:
368        rm -f ${bindir}/Singular${EXEC_EXT}
369        rm -f ${SINGULAR}
370        -rmdir ${bindir}
371
372##
373## clean targest
374##
375mostlyclean:
376        -rm -f Singular Singular-static Singularg Singularp Singularb libparse feOpt*.inc
377        -rm -f *.o *.og core *.op *.ob *.ot Singulart
378        -rm ESingular* TSingular*
379
380clean: mostlyclean
381         -rm -f *.aso *.bak *.d *.dd depend
382
383distclean: clean
384        -rm -f iparith.inc mpsr_Tok.inc stamp.h
385        -rm -f Singular* *.gprof *.bprof *~ .\#* version.h
386        -rm -f mod2.h Makefile TAGS* tags config.status config.cache config.log
387        -rm -f ${slibdir}
388
389srcclean:
390        @echo "This command is intended for maintainers to use;"
391        @echo "Rebuilding the deleted files requires flex"
392        @echo "bison, perl"
393        -rm -f scanner.cc grammar.h grammar.cc libparse.cc
394
395maintainer-clean: distclean srcclean
396        @echo "This command is intended for maintainers to use;"
397        @echo "Rebuilding the deleted files requires flex"
398        @echo "bison, perl and autoconf"
399        -rm configure
400
401##
402## miscellanous targets
403##
404
405install-bindist: $(HEADERS) $(SOURCES) Makefile depend
406        echo "#define MAKE_DISTRIBUTION " > distrib.h
407        sleep 1
408        ${MAKE} ${SING_EXEC} ESingular TSingular libparse ${RUN_SINGULARS}
409        ${MKINSTALLDIRS} ${install_bindir}
410        ${INSTALL_PROGRAM} -s  ${SING_EXEC} ${install_bindir}/Singular
411        ${INSTALL_PROGRAM} -s  libparse ${RUN_SINGULARS} ESingular TSingular ${install_bindir}
412        echo "#undef MAKE_DISTRIBUTION " > distrib.h
413
414install-sharedist: ${SLIBS_FILES} LIB/gftables
415        ${MKINSTALLDIRS} ${install_slibdir}
416        cp ${SLIBS_FILES} ${install_slibdir}
417        ${MKINSTALLDIRS} ${install_slibdir}/gftables
418        cp ${GFTABLES} ${install_slibdir}/gftables
419        chmod -R +rX ${install_slibdir}/*
420
421tar:
422        tar cf Singular-${SINGULAR_VERSION}-src.tar ${DISTFILES}
423        gzip -f Singular-${SINGULAR_VERSION}-src.tar
424
425
426TAGS:   ${SOURCES} ${HEADERS}
427        etags ${SOURCES} ${HEADERS}
428
429tags:   
430        ctags *.y *.l *.c *.h *.cc *.inc
431
432echoLIBS:
433        @echo ${SLIBS}
434
435##
436## Below here is stuff for developpers
437#################################################################
438
439##
440## compiler and linker options for debug version
441##
442
443CCG             = gcc
444CXXG            = gcc
445CXXM            = gcc -MM -MG -DGENERATE_DEPEND
446CCM             = gcc -MM -MG -DGENERATE_DEPEND
447
448CFLAGSG         = -g -Wall -Wno-unused ${PIPE}
449CXXFLAGSG       = -g -Wall -Wno-unused ${PIPE}
450CXXTEMPLFLAGSG  = -fno-implicit-templates
451DEFSG           = -D@SING_UNAME@ @DEFS@
452
453##
454## .og files for having -O and -g object versions available at the same time
455##
456
457OBJG1 := $(CXXSOURCES:.cc=.og)
458OBJG2 := $(CSOURCES:.c=.og)
459
460
461OBJG=$(OBJG1) $(OBJG2)
462
463##
464## Debug Targets
465##
466
467claptmpl.og: claptmpl.cc mod2.h
468        $(CXXG)  ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
469
470$(OBJG1) : %.og: %.cc
471        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
472
473$(OBJG2) gmalloc.og: %.og: %.c
474        $(CCG)  ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
475
476Singularg: scanner.cc gmalloc.og \
477           $(ASO_OBJS) $(OBJG)  \
478           iparith.og mpsr_Tok.og claptmpl.og tesths.cc version.h
479        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -o Singularg \
480        tesths.cc iparith.og mpsr_Tok.og claptmpl.og $(OBJG) ${LDFLAGS} ${LIBS} \
481        ${LD_DYN_FLAGS} gmalloc.og
482
483iparith.og: iparith.inc iparith.cc
484        $(CXXG)  ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c iparith.cc -o iparith.og
485
486mpsr_Tok.og: iparith.inc mpsr_Tok.cc
487        $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${CXXTEMPLFLAGSG} ${DEFSG} -c mpsr_Tok.cc -o mpsr_Tok.og
488
489installg: Singularg
490        ${MKINSTALLDIRS} ${bindir}
491        ${INSTALL_PROGRAM} Singularg ${bindir} 
492
493ESingularg: fegetopt.og feResource.cc mod2.h feOpt.cc version.h emacs.cc \
494           feOptES.inc
495        ${CXXG} -DESINGULAR -g ${DEFSG} -o ESingularg emacs.cc fegetopt.og ${LDFLAGS} ${LIBS}
496
497##
498## compiler and linker options for profile version
499##
500
501CCP             = gcc
502CXXP            = gcc
503
504CFLAGSP         = -pg -O3 ${PIPE}
505CXXFLAGSP       = -pg -O3 ${PIPE}
506CXXTEMPLFLAGSP  = -fno-implicit-templates
507DEFSP           = -DNDEBUG -DDO_PROFILE -D@SING_UNAME@ @DEFS@
508LDFLAGSP        = -static @LDFLAGS@
509
510CFLAGSB         = -g -O3 ${PIPE}
511CXXFLAGSB       = -g -O3 ${PIPE}
512CXXTEMPLFLAGSB  = -fno-implicit-templates
513DEFSB           = -D@SING_UNAME@ -DNDEBUG @DEFS@
514LDFLAGSB        = -static @LDFLAGS@
515
516# bprof object  file to link with
517BPROFOBJ        = /usr/local/lib/bmon.o
518
519DEFST           = -DNDEBUG -D@SING_UNAME@ -DMTRACK @DEFS@
520LDFLAGST        = @LDFLAGS@
521CFLAGST         = -g  -w ${PIPE}
522CXXFLAGST       = -g  -w ${PIPE}
523
524##
525## op and ob files for gprof and bprof, ot for mtrack
526##
527
528OBJP1 := $(CXXSOURCES:.cc=.op)
529OBJP2 := $(CSOURCES:.c=.op)
530OBJP=$(OBJP1) $(OBJP2)
531
532OBJB1 := $(CXXSOURCES:.cc=.ob)
533OBJB2 := $(CSOURCES:.c=.ob)
534OBJB=$(OBJB1) $(OBJB2)
535
536OBJT1 := $(CXXSOURCES:.cc=.ot)
537OBJT2 := $(CSOURCES:.c=.ot)
538OBJT=$(OBJT1) $(OBJT2)
539
540##
541## profile targets
542##
543
544## for gprof
545claptmpl.op: claptmpl.cc mod2.h
546        $(CXXP)  ${CXXFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@
547
548$(OBJP1): %.op: %.cc
549        $(CXXP) ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@
550
551$(OBJP2) gmalloc.op: %.op: %.c
552        $(CCP)  ${CFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@
553
554Singularp: scanner.cc  gmalloc.op \
555           $(ASO_OBJS) $(OBJP) \
556           iparith.op mpsr_Tok.op claptmpl.op tesths.cc version.h
557        $(CXXP) ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} -o Singularp \
558        tesths.cc iparith.op mpsr_Tok.op claptmpl.op $(OBJP) ${LDFLAGSP} ${LIBS} \
559        ${LD_DYN_FLAGS} gmalloc.op
560
561iparith.op: iparith.inc iparith.cc
562        $(CXXP)  ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} -c iparith.cc -o iparith.op
563
564mpsr_Tok.op: iparith.inc mpsr_Tok.cc
565        $(CXXP) ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} -c mpsr_Tok.cc -o mpsr_Tok.op
566
567
568## for bprof
569claptmpl.ob: claptmpl.cc mod2.h
570        $(CXXP)  ${CXXFLAGSP} ${CPPFLAGS} ${DEFSB} -c $< -o $@
571
572$(OBJB1): %.ob: %.cc
573        $(CXXP) ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSB} -c $< -o $@
574
575$(OBJB2) gmalloc.ob: %.ob: %.c
576        $(CCP)  ${CFLAGSP} ${CPPFLAGS} ${DEFSB} -c $< -o $@
577
578Singularb: scanner.cc  gmalloc.ob $(OBJB) iparith.ob mpsr_Tok.ob claptmpl.ob tesths.cc version.h
579        $(CXXP) ${CXXFLAGSP} ${CPPFLAGS} ${DEFSB} -o Singularb \
580        tesths.cc iparith.ob mpsr_Tok.ob claptmpl.ob $(OBJB) $(BPROFOBJ) \
581        ${LDFLAGSP} ${LIBS} ${LD_DYN_FLAGS} gmalloc.ob
582
583iparith.ob: iparith.inc iparith.cc
584        $(CXXP)  ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSB} -c iparith.cc -o iparith.ob
585
586mpsr_Tok.ob: iparith.inc mpsr_Tok.cc
587        $(CXXP) ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSB} -c mpsr_Tok.cc -o mpsr_Tok.ob
588
589#
590# for mtrack
591#
592claptmpl.ot: claptmpl.cc mod2.h
593        $(CXXP)  ${CXXFLAGST} ${CPPFLAGS} ${DEFST} -c $< -o $@
594
595$(OBJT1): %.ot: %.cc
596        $(CXXP) ${CXXFLAGST} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFST} -c $< -o $@
597
598$(OBJT2) gmalloc.ot: %.ot: %.c
599        $(CCP)  ${CFLAGST} ${CPPFLAGS} ${DEFST} -c $< -o $@
600
601Singulart: scanner.cc  gmalloc.ot $(OBJT) iparith.ot mpsr_Tok.ot claptmpl.ot tesths.cc version.h
602        $(CXXP) ${CXXFLAGST} ${CPPFLAGS} ${DEFST} -o Singulart \
603        tesths.cc iparith.ot mpsr_Tok.ot claptmpl.ot $(OBJT) ${LDFLAGST} ${LIBS} \
604        ${LD_DYN_FLAGS} gmalloc.ot
605
606iparith.ot: iparith.inc iparith.cc
607        $(CXXP)  ${CXXFLAGST} ${CXXTEMPLFLAGSB} ${CPPFLAGS} ${DEFST} -c iparith.cc -o iparith.ot
608
609mpsr_Tok.ot: iparith.inc mpsr_Tok.cc
610        $(CXXP) ${CXXFLAGST} ${CXXTEMPLFLAGSB} ${CPPFLAGS} ${DEFST} -c mpsr_Tok.cc -o mpsr_Tok.ot
611
612
613##
614## check_aso
615##
616check_aso:
617        ${PERL} check_aso.pl $(SOURCES)
618##
619## dependencies
620##
621
622%.aso.dd: %.aso.cc mod2.h aso.h
623        $(CXXM) ${CPPFLAGS} ${DEFS} $< >> $@
624
625%.dd: %.cc mod2.h
626        echo $(@:.dd=.og) $(@:.dd=.op) $(@:.dd=.ob) $(@:.dd=.ot)" " \\ > $@
627        $(CXXM) -DGENTABLE ${CPPFLAGS} ${DEFSG} $< >> $@
628
629%.d: %.c mod2.h
630        echo $(@:.d=.og) $(@:.d=.op) $(@:.d=.ob) $(@:.d=.ot)" " \\ > $@
631        $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@
632
633depend:   $(ASO_SOURCES:.cc=.dd) $(CXXSOURCES:.cc=.dd) $(CSOURCES:.c=.d) mod2.h
634        cat *.d *.dd >depend
635
636ifeq (depend,$(wildcard depend))
637include depend
638endif
639
640
641
Note: See TracBrowser for help on using the repository browser.