source: git/Singular/Makefile.in @ 7ec0614

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