source: git/Singular/Makefile.in @ 27fa8f9

spielwiese
Last change on this file since 27fa8f9 was 27fa8f9, checked in by Hans Schönemann <hannes@…>, 15 years ago
*hannes: cimonom.lib git-svn-id: file:///usr/local/Singular/svn/trunk@11105 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 20.7 KB
Line 
1################################################################
2###
3### Makefile for Singular
4###
5#################################################################
6
7SHELL           = /bin/sh
8
9##
10## version
11##
12SINGULAR_VERSION        = @SINGULAR_VERSION@
13SINGULAR                = @SINGULAR@
14SINGUNAME               = @SINGUNAME@
15EXEC_EXT                = @EXEC_EXT@
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    calcSVD.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
250ifeq ($(HAVE_MPSR), 1)
251LIBS := $(MP_LIBS) $(LIBS)
252LIBSG := $(MP_LIBS) $(LIBSG)
253endif
254endif
255OBJS := $(OBJS) $(STATIC_SOURCES:.cc=.o) $(COMMON_SOURCES:.cc=.o)
256OBJSG := $(OBJSG) $(STATIC_SOURCES:.cc=.og) $(COMMON_SOURCES:.cc=.og)
257DL_LIBS=
258endif
259
260#
261# Singular libraries which go into distribution
262# MAKE SURE THAT THIS IS UP_TO_DATE
263#
264
265SLIB0 = absfact.lib  arcpoint.lib  atkins.lib    aksaka.lib    ainvar.lib\
266        alexpoly.lib algebra.lib   brnoeth.lib   curvepar.lib  cimonom.lib \
267        classify.lib compregb.lib \
268        control.lib  curvepar.lib   crypto.lib    deform.lib   elim.lib \
269        equising.lib freegb.lib \
270        finvar.lib   gmspoly.lib   gmssing.lib   general.lib   graphics.lib \
271        grwalk.lib   groups.lib    hnoether.lib  homolog.lib   hyperel.lib \
272        inout.lib    intprog.lib   kskernel.lib  latex.lib     linalg.lib \
273        lll.lib      makedbm.lib   matrix.lib \
274        modstd.lib   mondromy.lib  mprimdec.lib  mregular.lib  rootsmr.lib \
275        noether.lib  normal.lib    ntsolve.lib  \
276        poly.lib     presolve.lib  primdec.lib   primitiv.lib   qhmoduli.lib \
277        random.lib   realrad.lib   redcgs.lib    reesclos.lib   resolve.lib \
278        resgraph.lib reszeta.lib \
279        ring.lib     rinvar.lib    sagbi.lib     sheafcoh.lib   sing.lib \
280        solve.lib    signcond.lib  spcurve.lib   spectrum.lib   standard.lib \
281        stratify.lib surf.lib      surfex.lib    teachstd.lib   toric.lib \
282        triang.lib   rootsur.lib  weierstr.lib  zeroset.lib     phindex.lib
283 
284
285PLIBS = bfct.lib central.lib discretize.lib dmod.lib dmodapp.lib freegb.lib \
286        gkdim.lib involut.lib ncalg.lib ncdecomp.lib nchomolog.lib nctools.lib \
287        perron.lib qmatrix.lib
288
289ifdef HAVE_PLURAL
290SLIBS = COPYING ${SLIB0} ${PLIBS} all.lib help.cnf
291else
292SLIBS = COPYING ${SLIB0} all.lib help.cnf
293endif
294
295SLIBS_FILES = $(addprefix LIB/,${SLIBS})
296
297GFTABLES = $(wildcard LIB/gftables/[1-9]*)
298
299##
300## Build Targets
301##
302.l.cc:
303        @if test -r scanner.cc; then \
304                touch scanner.cc ;\
305        elif test "x${LEX}" = x; then \
306                echo Error: no lex given, could not rebuilt scanner.cc;\
307                exit 1; \
308        fi
309        ${LEX} -s -I -t $< > scanner.cc.lmp
310        cp scanner.cc.lmp scanner.cc
311
312.y.cc:
313        @if test -r grammar.cc; then \
314                touch grammar.cc ;\
315        else \
316        if test "x${BISON}" = x; then \
317                echo Error: no bison given, could not rebuilt grammar.cc;\
318                exit 1; \
319        fi;\
320        ${BISON} -d -t -o grammar.cc $<;\
321        chmod +x testgh;\
322        ./testgh;\
323        fi
324
325.cc.o: 
326        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} -c $<
327.c.o:
328        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $<
329
330%.dl_o : %.cc
331        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} ${SFLAGS} -c $< -o $@
332
333all:    $(SING_EXEC)
334
335Singular-static: version.h
336        sleep 1
337        echo "#define HAVE_STATIC" > static.h
338        (cd ../kernel;${MAKE} LD_STATIC=1 install-bindist;cd ..//Singular)
339        ${MAKE} LD_STATIC=1 S_EXT="-static" Singular-static
340        echo "#undef HAVE_STATIC" > static.h
341
342Singular${S_EXT}: mod2.h Makefile version.h $(WIN_LIBS) scanner.cc  ${OBJS} \
343          iparith.o tesths.cc libparse.cc claptmpl.o mpsr_Tok.o $(DL_LIBS)
344        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} \
345          -o Singular${S_EXT} \
346          tesths.cc iparith.o mpsr_Tok.o claptmpl.o\
347          ${OBJS} ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o
348
349libsingular: mod2.h Makefile version.h $(WIN_LIBS) scanner.cc  ${OBJS} \
350         iparith.o libsingular-tesths.o libparse.cc claptmpl.o mpsr_Tok.o $(DL_LIBS)
351        $(LIBSINGULAR_LD) ${SLDFLAGS} ${LIBSINGULAR_FLAGS} -o libsingular.${SO_SUFFIX} \
352        libsingular-tesths.o iparith.o mpsr_Tok.o claptmpl.o \
353        ${OBJS} -lkernel -L../kernel -L../factory -L../libfac -L${libdir} ${LIBSINGULAR_LIBS}
354
355libsingular.a: mod2.h Makefile version.h $(WIN_LIBS) scanner.cc  ${OBJS} \
356         iparith.o libsingular-tesths.o libparse.cc claptmpl.o mpsr_Tok.o
357        mkdir libsingular.tmp
358        (cd  libsingular.tmp; \
359        ar x ../../kernel/libkernel.a; \
360        ar x ../../$(SINGUNAME)/lib/libsingfac.a; \
361        ar x ../../$(SINGUNAME)/lib/libsingcf.a; \
362        ar x ../../$(SINGUNAME)/lib/libsingcf.a; \
363        ar x ../../$(SINGUNAME)/lib/libntl.a; \
364        ar x ../../$(SINGUNAME)/lib/libomalloc_ndebug.a; \
365        cd ..)
366        ar cr libsingular.a \
367        iparith.o mpsr_Tok.o claptmpl.o \
368        ${OBJS} libsingular.tmp/*
369        rm -rf libsingular.tmp
370
371libsingular-tesths.o: tesths.cc
372        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} -DLIBSINGULAR \
373          ${SLDFLAGS} -o libsingular-tesths.o \
374          -c tesths.cc
375
376../modules/python/libpython_module.a:
377        cd ../modules/python; scons
378
379%.static: version.h
380        ${MAKE} DL_KERNEL=0 S_EXT=".static" $@
381
382iparith.o mpsr_Tok.o : iparith.inc mpsr_Tok.inc
383
384cntrlc.o cntrlc.og : feOptES.inc feOptTS.inc feOpt.inc
385
386claptmpl.o: claptmpl.cc mod2.h
387        ${CXX} ${CXXFLAGS}  ${CPPFLAGS} ${DEFS} -c $<
388
389iparith.inc mpsr_Tok.inc: claptmpl.o iparith.cc \
390                          ipconv.cc tok.h mpsr_Tok.cc grammar.h mod2.h
391        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} -DGENTABLE \
392             -o gentable claptmpl.o iparith.cc tesths.cc mpsr_Tok.cc \
393             ${OBJS} ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o
394        ./gentable
395        /bin/rm -f gentable gentable.exe
396
397
398version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in \
399           configure.in
400        echo "#define feVersionId "  `date '+%Y%m%d%H'` >version.h
401        echo "#define CC \"" ${CC} ${CFLAGS} ${DEFS}"\"" >>version.h
402        echo "#define CXX \"" ${CXX} ${CXXFLAGS} ${DEFS} "\"" >>version.h
403
404libparse: libparse_main.o utils.o
405        ${CXX}  ${CPPFLAGS} -DSTANDALONE_PARSER -o libparse libparse_main.o utils.o ../kernel/fegetopt.o ${LDFLAGS2} -lomalloc_ndebug
406
407libparse_main.o: libparse.cc
408        ${CXX} ${CPPFLAGS} -c -o libparse_main.o libparse.cc  -DSTANDALONE_PARSER
409
410libparse.cc: libparse.l
411        @if test "x${LEX}" = x; then \
412                echo Error: no lex given, could not rebuilt libparse.cc;\
413                exit 1; \
414        fi
415        ${LEX} -I -Pyylp -t libparse.l >libparse.cc.lmp
416        cp libparse.cc.lmp libparse.cc
417
418# Hmm compiling with -fomit-frame-pointer resulted in access violation
419# under cygwin
420ESingular: mod2.h feOpt.cc version.h emacs.cc \
421           feOptES.inc
422        ${CXX} -O2 ${CPPFLAGS} ${DEFS} -DESINGULAR -DPROTO -o ESingular emacs.cc ../kernel/fegetopt.o \
423        ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o
424
425TSingular: mod2.h feOpt.cc version.h emacs.cc \
426           feOptTS.inc
427        ${CXX} -O2 ${CPPFLAGS} ${DEFS} -DTSINGULAR -DPROTO -o TSingular emacs.cc ../kernel/fegetopt.o \
428        ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o
429
430feOpt.o: feOpt.inc feOptES.inc feOptTS.inc
431extra.o: feOpt.inc
432
433feOpt.inc: feOpt.cc mod2.h
434        $(CXX) -DGENERATE_OPTION_INDEX -I../kernel feOpt.cc -o feOpt
435        ./feOpt
436        /bin/rm -f feOpt feOpt.exe
437
438feOptES.inc: feOpt.cc mod2.h
439        $(CXX) -DGENERATE_OPTION_INDEX  -DESINGULAR -I../kernel feOpt.cc -o feOpt
440        ./feOpt
441        rm -f feOpt feOpt.exe
442
443feOptTS.inc: feOpt.cc mod2.h
444        $(CXX) -DGENERATE_OPTION_INDEX  -DTSINGULAR -I../kernel feOpt.cc -o feOpt
445        ./feOpt
446        rm -f feOpt feOpt.exe
447
448mpsr.so: $(MPSR_SOURCES:.cc=.dl_o)
449        $(LD) ${SLDFLAGS} -o $@ $^ -L${libdir} ${MP_LIBS} ${GLIBC_DYN_FIX}
450
451dbmsr.so: $(DBMSR_SOURCES:.cc=.dl_o)
452        $(LD) ${SLDFLAGS} -o $@ $^ ${GLIBC_DYN_FIX}
453
454src: scanner.cc grammar.h grammar.cc libparse.cc
455
456mod2.h: stamp-h
457
458stamp-h : config.status mod2.h.in
459        CONFIG_FILES= CONFIG_HEADERS="mod2.h" ./config.status
460
461Makefile: Makefile.in config.status
462        CONFIG_FILES="Makefile" CONFIG_HEADERS= ./config.status
463
464config.status: configure
465        ./config.status --recheck
466
467configure: configure.in
468        @echo "WARNING: You need to rerun autoconf. I am proceeding, for now."
469        @touch configure
470#       autoconf
471
472ifeq ($(SINGUNAME),ix86-Win)
473##
474## windows only targets
475##
476
477## resources
478Singular.rc: Singular.rc.in config.status
479        CONFIG_FILES="Singular.rc" CONFIG_HEADERS= ./config.status
480
481ESingular_res.o: Singular.rc
482        windres -DESINGULAR -i Singular.rc -o ESingular_res.o
483
484TSingular_res.o: Singular.rc
485        windres -DTSINGULAR -i Singular.rc -o TSingular_res.o
486
487Singular_res.o: Singular.rc
488        windres -DSINGULAR -i Singular.rc -o Singular_res.o
489
490## run
491run.o: run.c run.h
492        gcc -c -I. -O2 run.c -o run.o
493
494runTSingular : run.o TSingular_res.o
495        gcc -mwindows run.o TSingular_res.o -o runTSingular.exe
496#       gcc -mwindows -e _mainCRTStartup run.o TSingular_res.o -o runTSingular.exe
497
498runESingular : run.o ESingular_res.o
499        gcc -mwindows run.o ESingular_res.o -o runESingular.exe
500#       gcc -mwindows -e _mainCRTStartup run.o ESingular_res.o -o runESingular.exe
501
502RUN_SINGULARS=runESingular runTSingular
503
504endif
505
506##
507## install targets
508##
509install: all installbin installslib
510
511install-nolns: all installbin-nolns installslib-nolns
512
513installbin: ${SING_EXEC} libparse ESingular TSingular ${RUN_SINGULARS}
514        ${MKINSTALLDIRS} ${bindir}
515        ${INSTALL_PROGRAM} ${SING_EXEC} ${SINGULAR}
516        -for file in *.so; do \
517          ${INSTALL_PROGRAM} $$file ${bindir}; \
518        done
519        ${INSTALL_PROGRAM} libparse ${RUN_SINGULARS} ${bindir}
520        ${INSTALL_PROGRAM} ESingular TSingular ${DL_LIBS} ${bindir}
521        ${INSTALL_PROGRAM} surfex ${bindir}
522        chmod a+x ${SINGULAR}
523        rm -f ${bindir}/${SING_EXEC}${EXEC_EXT}
524        cd ${bindir}; ${LN_S} ${SINGULAR} Singular${EXEC_EXT};
525
526installbin-nolns: ${SING_EXEC} libparse ESingular TSingular ${RUN_SINGULARS}
527        ${MKINSTALLDIRS} ${bindir}
528        ${INSTALL_PROGRAM} ${SING_EXEC} ${SINGULAR}
529        -for file in *.so; do \
530          ${INSTALL_PROGRAM} $$file ${bindir}; \
531        done
532        ${INSTALL_PROGRAM} libparse ${RUN_SINGULARS} ${bindir}
533        ${INSTALL_PROGRAM} ESingular TSingular ${DL_LIBS} ${bindir}
534        chmod a+x ${SINGULAR}
535        rm -f ${bindir}/${SING_EXEC}${EXEC_EXT}
536        ${INSTALL_PROGRAM} ${SINGULAR} ${bindir}/Singular${EXEC_EXT};
537
538installslib: LIB
539        test -r ${slibdir} || ${LN_S} `pwd`/LIB ${slibdir}
540
541installslib-nolns: LIB
542        ${MKINSTALLDIRS} ${slibdir}
543        for file in `pwd`/LIB/*.lib; do \
544          ${INSTALL_DATA}  $$file ${slibdir}; \
545        done
546        ${MKINSTALLDIRS} ${slibdir}/gftables
547        ${INSTALL_DATA} `pwd`/LIB/gftables/* ${slibdir}/gftables/
548
549install-libsingular: libsingular
550        for file in *.$(SO_SUFFIX); do \
551          ${INSTALL_PROGRAM}  $$file ${libdir}; \
552        done
553        ${INSTALL_PROGRAM} libsingular.h ${includedir}
554
555
556
557uninstall: uninstallbin
558
559uninstallbin:
560        rm -f ${bindir}/Singular${EXEC_EXT}
561        rm -f ${SINGULAR}
562        -rmdir ${bindir}
563
564##
565## clean targest
566##
567mostlyclean:
568        -rm -f Singular Singular-static Singulara Singularg Singularp Singularb libparse feOpt*.inc
569        -rm -f *.o *.og core *.op *.ot Singulart *.od *.so* *.dl_o*
570        -rm -f ESingular* TSingular*
571
572clean: mostlyclean
573        -rm -f *.bak *.d *.dd depend
574        -rm -f ${slibdir}
575
576distclean: clean
577        -rm -f iparith.inc mpsr_Tok.inc stamp.h
578        -rm -f Singular* *.gprof *.bprof *~ .\#* version.h
579        rm -f plural_cmd.inc
580        -rm -f mod2.h Makefile TAGS* tags config.status config.cache config.log
581
582srcclean:
583        @echo "This command is intended for maintainers to use;"
584        @echo "Rebuilding the deleted files requires flex"
585        @echo "bison, perl"
586        -rm -f scanner.cc grammar.h grammar.cc libparse.cc
587
588maintainer-clean: distclean srcclean
589        @echo "This command is intended for maintainers to use;"
590        @echo "Rebuilding the deleted files requires flex"
591        @echo "bison, perl and autoconf"
592        -rm configure
593
594##
595## miscellanous targets
596##
597LIB/all.lib:    LIB/all.lib.tmpl
598        ./make_alllib.sh LIB/all.lib.tmpl ${SLIB0} ${PLIBS}
599
600install-bindist: $(HEADERS) $(SOURCES) Makefile depend
601        echo "#define MAKE_DISTRIBUTION " > distrib.h
602        sleep 1
603        ${MAKE} ${SING_EXEC} ESingular TSingular libparse ${RUN_SINGULARS}
604        ${MKINSTALLDIRS} ${install_bindir}
605        ${INSTALL_PROGRAM} -s  ${SING_EXEC} ${install_bindir}/Singular
606        -${INSTALL_PROGRAM} *.so ${install_bindir}
607        ${INSTALL_PROGRAM} -s  libparse ${RUN_SINGULARS} ESingular TSingular ${DL_LIBS} ${install_bindir}
608        ${INSTALL_PROGRAM} surfex ${install_bindir}
609        echo "#undef MAKE_DISTRIBUTION " > distrib.h
610
611install-bindist-plural: install-bindist
612
613install-sharedist-plural: install-sharedist
614
615install-sharedist: ${SLIBS_FILES} LIB/gftables
616        ${MKINSTALLDIRS} ${install_slibdir}
617        cp ${SLIBS_FILES} ${install_slibdir}
618        ${MKINSTALLDIRS} ${install_slibdir}/gftables
619        cp ${GFTABLES} ${install_slibdir}/gftables
620        ${MKINSTALLDIRS} ${install_slibdir}/surfex
621        cp LIB/surfex/surfex.jar ${install_slibdir}
622        chmod -R +rX ${install_slibdir}/*
623
624tar:
625        tar cf Singular-${SINGULAR_VERSION}-src.tar ${DISTFILES}
626        gzip -f Singular-${SINGULAR_VERSION}-src.tar
627
628backup: tar
629        mcopy -o Singular-${SINGULAR_VERSION}-src.tar.gz a:
630
631TAGS:   ${SOURCES} ${ESOURCES} ${HEADERS}
632        etags ${SOURCES} ${ESOURCES} ${HEADERS} ../kernel/*.[ch] ../kernel/*.cc ../kernel/*.inc
633
634
635tags:   
636        ctags *.y *.[lch] *.cc *.inc ../kernel/*.[ch] ../kernel/*.cc ../kernel/*.inc
637
638echoLIBS:
639        @echo ${SLIBS}
640
641##
642## Below here is stuff for developpers
643#################################################################
644
645
646##
647## .og files for having -O and -g object versions available at the same time
648##
649
650OBJG1 := $(CXXSOURCES:.cc=.og)
651OBJG2 := $(CSOURCES:.c=.og)
652
653OBJG=$(OBJG1) $(OBJG2)
654
655DL_TAILG=\"sog\"
656
657
658ifeq ($(DL_KERNEL),1)
659
660OBJG := $(OBJG) $(DL_KERNEL_SOURCES:.cc=.og)
661DL_LIBSG := $(MPSR_SO:%.so=%.sog) $(DBMSR_SO:%.so=%.sog)
662
663else
664
665OBJG := $(OBJG) $(STATIC_SOURCES:.cc=.og) $(COMMON_SOURCES:.cc=.og)
666DL_LIBSG=
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} ${GLIBC_DYN_FIX}
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## dependencies
729##
730
731%.dd: %.cc mod2.h
732        echo $(@:.dd=.og) $(@:.dd=_d.cc) $(@:.dd=.dl_o) $(@:.dd=.dl_og)" " \\ > $@
733        $(CXXM) -DGENTABLE ${CPPFLAGS} ${DEFSG} $< >> $@
734
735%.d: %.c mod2.h
736        echo $(@:.d=.og) $(@:.dd=_d.c)" " \\ > $@
737        $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@
738
739depend:   $(CXXSOURCES:.cc=.dd) $(ESOURCES:.cc=.dd) $(CSOURCES:.c=.d) mod2.h claptmpl.dd
740        -cat *.dd >>depend
741
742ifeq (depend,$(wildcard depend))
743include depend
744endif
745
746
Note: See TracBrowser for help on using the repository browser.