source: git/Singular/Makefile.in @ 751bfd

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