source: git/Singular/Makefile.in @ 8e1f0d

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