source: git/Singular/Makefile.in @ 237b3e4

spielwiese
Last change on this file since 237b3e4 was ad0c5c, checked in by Hans Schoenemann <hannes@…>, 14 years ago
findiff.lib for beta test included git-svn-id: file:///usr/local/Singular/svn/trunk@13045 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 22.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@ -I@prefix@ ${PIPE}
55CXXTEMPLFLAGS   = @CXXTEMPLFLAGS@ -I@prefix@
56ifneq ($(SINGUNAME),ix86-Win)
57CPPFLAGS        = -I${srcdir} -I../kernel -I@prefix@ @CPPFLAGS@
58else
59## Dirs after @CPPFLAGS@ are for PySingular
60CPPFLAGS        = -I${srcdir} -I@prefix@ @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@prefix@/kernel -lkernel @LDFLAGS@
67LDFLAGSG        = -L@prefix@/kernel -lkernel_g @LDFLAGS@
68LDFLAGSP        = -L@prefix@/kernel -lkernel_p @LDFLAGS@
69else
70## -L/usr/local/lib -L@prefix@/modules/python --> PySingular
71LDFLAGS         = -L@prefix@/kernel -L/bin -lkernel @LDFLAGS@ -L/usr/local/lib -L../modules/python
72LDFLAGSG        = -L@prefix@/kernel -L/bin -lkernel_g @LDFLAGS@
73LDFLAGSP        = -L@prefix@/kernel -L/bin -lkernel_p @LDFLAGS@
74endif
75LD_DYN_FLAGS    = @LD_DYN_FLAGS@
76SFLAGS          = @SFLAGS@
77SLDFLAGS        = @SLDFLAGS@
78
79## For PYSingular
80ifneq ($(SINGUNAME),ix86-Win)
81WIN_LIBS        =
82else
83WIN_LIBS        =
84##../modules/python/libpython_module.a
85endif
86
87LD_LIBC         = -lc
88STATIC_LDFLAGS  = @STATIC_LDFLAGS@
89# under cygwin, do not explicitly link against -lm, for it is the cygwin
90# lib -- if you really want to do this, use -lm as the _last_ thing on the
91# arguments to link
92ifneq ($(SINGUNAME),ix86-Win)
93LIBS            = -lm @NEED_LIBS@
94LIBSG           = -lm @NEED_LIBSG@
95LIBSP           = -lm @NEED_LIBSG@
96else
97LIBS            = -lsingfac -lsingcf -lntl  -static -lreadline -lhtmlhelp -Xlinker -Bdynamic -lgmp -lomalloc_ndebug -lncurses
98## -lpython_module -lpython2.4 /usr/local/lib/libboost_python-gcc-d-1_32.dll
99LIBSG           = -lsingfac -lsingcf -lntl  -static -lreadline -lhtmlhelp -Xlinker -Bdynamic -lgmp -lncurses
100endif
101MP_LIBS         = @MP_LIBS@
102HAVE_MPSR       = @HAVE_MPSR@
103
104#
105# Handle libSINGULAR stuff
106#
107LIBSINGULAR_LIBS =-lsingfac -lsingcf -lntl -lreadline -lgmp -lomalloc
108
109SO_SUFFIX = so
110#LIBSINGULAR_FLAGS = -export-dynamic
111LIBSINGULAR_LD = $(CXX)
112
113# correct suffix for dynamic linking
114ifeq ($(SINGUNAME),ix86Mac-darwin)
115SO_SUFFIX        = dylib
116LIBSINGULAR_FLAGS = -single_module
117LIBSINGULAR_LD = $(LD)
118endif
119
120ifeq ($(SINGUNAME),ppcMac-darwin)
121MACOSX_DEPLOYMENT_TARGET=10.4
122SO_SUFFIX        = dylib
123LIBSINGULAR_FLAGS = -single_module
124LIBSINGULAR_LD = $(LD)
125endif
126
127ifeq ($(SINGUNAME),ix86-Win)
128SO_SUFFIX = dll
129LIBSINGULAR_FLAGS = -shared
130LIBSINGULAR_LIBS = -lsingfac -lsingcf -lntl -lreadline -lgmp -lomalloc  -lhtmlhelp
131endif
132
133ifeq ($(SINGUNAME),ix86-SunOS)
134SO_SUFFIX  = so
135LIBSINGULAR_FLAGS = -shared
136LIBSINGULAR_LIBS = -lsingfac -lsingcf -lntl -lreadline -lgmp -lomalloc
137endif
138
139#
140# End libSINGULAR
141#
142
143ifdef LD_STATIC
144LDFLAGS  := ${STATIC_LDFLAGS} ${LDFLAGS}
145SING_EXEC = Singular-static
146LIBS := ${MP_LIBS} ${LIBS}
147LIBSG := ${MP_LIBS} ${LIBSG}
148DL_KERNEL =
149GLIBC_DYN_FIX=
150else
151LDFLAGS  := ${LD_DYN_FLAGS} ${LDFLAGS}
152SING_EXEC = Singular
153DL_KERNEL       = @DL_KERNEL@
154GLIBC_DYN_FIX= @GLIBC_DYN_FIX@
155endif
156
157# CXXFLAGS =  -g -Wall -Wno-unused
158# CFLAGS =  -g -Wall -Wno-unused
159##
160## End configuration dependend stuff
161#################################################################
162
163###
164### file sets
165###
166
167# normal C++ source files
168CXXSOURCES=grammar.cc scanner.cc attrib.cc \
169    eigenval_ip.cc\
170    extra.cc fehelp.cc feOpt.cc \
171    ipassign.cc ipconv.cc ipid.cc iplib.cc \
172    ipprint.cc ipshell.cc \
173    lists.cc \
174    sdb.cc \
175    fglm.cc interpolation.cc\
176    silink.cc \
177    subexpr.cc \
178    janet.cc wrapper.cc\
179    libparse.cc sing_win.cc\
180    gms.cc pcv.cc maps_ip.cc\
181    walk.cc walk_ip.cc \
182    cntrlc.cc misc_ip.cc \
183    calcSVD.cc \
184    Minor.cc \
185    MinorProcessor.cc \
186    MinorInterface.cc
187
188# stuff for MP
189MPSR_SOURCES = mpsr_Put.cc mpsr_PutPoly.cc mpsr_GetPoly.cc mpsr_sl.cc\
190        mpsr_Get.cc mpsr_GetMisc.cc mpsr_Error.cc \
191
192
193# stuff for dbm
194DBMSR_SOURCES =  ndbm.cc sing_dbm.cc
195
196# normal C source files
197CSOURCES=
198
199# C++ sources which are used if part of the kernel are dynamically linked
200DL_KERNEL_SOURCES=slInit_Dynamic.cc
201
202# C++ sources which are used for dynamic libraries if part of the kernel is
203# dynamically linked
204DL_LIB_SOURCES=
205
206# C++ sources which are used if no parts of the kernel are dynamically linked
207STATIC_SOURCES=slInit_Static.cc
208
209# C++ sources for which both, shared and static object files are needed
210COMMON_SOURCES = $(MPSR_SOURCES) $(DBMSR_SOURCES)
211
212# special C++ source files (need extra compiling and/or linking), for which
213# dependencies should be generated
214ESOURCES=iparith.cc $(COMMON_SOURCES) \
215        $(DL_KERNEL_SOURCES) $(DL_LIB_SOURCES) $(STATIC_SOURCES)
216
217SOURCES=${CSOURCES} ${CXXSOURCES} \
218        grammar.y scanner.l libparse.l \
219        utils.cc utils.h \
220        tesths.cc mpsr_Tok.cc claptmpl.cc
221
222HEADERS=lists.h attrib.h \
223        mpsr_Tok.h \
224        ipconv.h \
225        subexpr.h ipid.h \
226        cntrlc.h ipprint.h sdb.h \
227        ipshell.h tok.h \
228        silink.h \
229        sing_dbm.h maps_ip.h interpolation.h \
230        mpsr.h mpsr_sl.h\
231        mpsr_Get.h janet.h\
232        mpsr_Put.h walk.h\
233        dbm_sl.h libparse.h \
234        gms.h pcv.h eigenval_ip.h \
235        distrib.h walk.h \
236        static.h \
237        omSingularConfig.h
238
239DISTFILES=${SOURCES} ${HEADERS} ${ESOURCES} \
240        Makefile.in configure.in configure \
241        mod2.h.in grammar.h testgh install-sh mkinstalldirs \
242        check_aso.pl
243
244OBJS := $(CXXSOURCES:.cc=.o) $(CSOURCES:.c=.o)
245
246ifeq ($(SINGUNAME),ix86-Win)
247OBJS := $(OBJS) Singular_res.o
248endif
249
250P_PROCS_MODULES = FieldZp FieldIndep FieldQ FieldGeneral
251
252ifeq ($(DL_KERNEL),1)
253OBJS    := $(OBJS) $(DL_KERNEL_SOURCES:.cc=.o)
254DBMSR_SO= dbmsr.so
255DL_LIBS := $(DBMSR_SO)
256ifeq ($(HAVE_MPSR), 1)
257MPSR_SO =       mpsr.so
258DL_LIBS :=      $(DL_LIBS) $(MPSR_SO)
259endif
260else
261ifndef LD_STATIC
262ifeq ($(HAVE_MPSR), 1)
263LIBS := $(MP_LIBS) $(LIBS)
264LIBSG := $(MP_LIBS) $(LIBSG)
265endif
266endif
267OBJS := $(OBJS) $(STATIC_SOURCES:.cc=.o) $(COMMON_SOURCES:.cc=.o)
268OBJSG := $(OBJSG) $(STATIC_SOURCES:.cc=.og) $(COMMON_SOURCES:.cc=.og)
269DL_LIBS=
270endif
271
272
273#
274# Singular libraries which go into distribution
275# MAKE SURE THAT THIS IS UP_TO_DATE
276#
277include singular-libs
278
279ifdef HAVE_PLURAL
280SLIBS = COPYING ${SLIB0} ${SLIB1} ${PLIBS} all.lib help.cnf
281else
282SLIBS = COPYING ${SLIB0} ${SLIB1} all.lib help.cnf
283endif
284
285SLIBS_FILES = $(addprefix LIB/,${SLIBS})
286
287GFTABLES = $(wildcard LIB/gftables/[1-9]*)
288
289##
290## Build Targets
291##
292.l.cc:
293        @if test -r scanner.cc; then \
294                touch scanner.cc ;\
295        elif test "x${LEX}" = x; then \
296                echo Error: no lex given, could not rebuilt scanner.cc;\
297                exit 1; \
298        fi
299        ${LEX} -s -I -t $< > scanner.cc.lmp
300        cp scanner.cc.lmp scanner.cc
301
302.y.cc:
303        @if test -r grammar.cc; then \
304                touch grammar.cc ;\
305        else \
306        if test "x${BISON}" = x; then \
307                echo Error: no bison given, could not rebuilt grammar.cc;\
308                exit 1; \
309        fi;\
310        ${BISON} -d -t -o grammar.cc $<;\
311        chmod +x testgh;\
312        ./testgh;\
313        fi
314
315.cc.o: 
316        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} -c $<
317.c.o:
318        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $<
319
320%.dl_o : %.cc
321        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} ${SFLAGS} -c $< -o $@
322
323all:    $(SING_EXEC)
324
325Singular-static: version.h
326        sleep 1
327        echo "#define HAVE_STATIC" > static.h
328        (cd ../kernel;rm -f mod_raw.o;${MAKE} LD_STATIC=1 depend install-bindist;cd ../Singular)
329        ${MAKE} LD_STATIC=1 S_EXT="-static" depend Singular-static
330        echo "#undef HAVE_STATIC" > static.h
331
332Singular${S_EXT}: mod2.h Makefile version.h $(WIN_LIBS) scanner.cc  ${OBJS} \
333          iparith.o tesths.cc libparse.cc claptmpl.o mpsr_Tok.o $(DL_LIBS)
334        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} \
335          -o Singular${S_EXT} \
336          tesths.cc iparith.o mpsr_Tok.o claptmpl.o\
337          ${OBJS} ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o
338
339libsingular: mod2.h Makefile version.h $(WIN_LIBS) scanner.cc  ${OBJS} \
340         iparith.o libsingular-tesths.o libparse.cc claptmpl.o mpsr_Tok.o $(DL_LIBS)
341        $(LIBSINGULAR_LD) ${SLDFLAGS} ${LIBSINGULAR_FLAGS} -o libsingular.${SO_SUFFIX} \
342        libsingular-tesths.o iparith.o mpsr_Tok.o claptmpl.o \
343        ${OBJS} -lkernel -L../kernel -L../factory -L../libfac -L${libdir} ${LIBSINGULAR_LIBS}
344
345libsingular.a: mod2.h Makefile version.h $(WIN_LIBS) scanner.cc  ${OBJS} \
346         iparith.o libsingular-tesths.o libparse.cc claptmpl.o mpsr_Tok.o
347        mkdir libsingular.tmp
348        (cd  libsingular.tmp; \
349        ar x ../../kernel/libkernel.a; \
350        ar x ../../$(SINGUNAME)/lib/libsingfac.a; \
351        ar x ../../$(SINGUNAME)/lib/libsingcf.a; \
352        ar x ../../$(SINGUNAME)/lib/libntl.a; \
353        ar x ../../$(SINGUNAME)/lib/libomalloc_ndebug.a; \
354        cd ..)
355        ar cr libsingular.a \
356        iparith.o mpsr_Tok.o claptmpl.o \
357        ${OBJS} libsingular.tmp/*
358        rm -rf libsingular.tmp
359
360libsingular-tesths.o: tesths.cc
361        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} -DLIBSINGULAR \
362          ${SLDFLAGS} -o libsingular-tesths.o \
363          -c tesths.cc
364
365../modules/python/libpython_module.a:
366        cd ../modules/python; scons
367
368%.static: version.h
369        ${MAKE} DL_KERNEL=0 S_EXT=".static" $@
370
371iparith.o mpsr_Tok.o : iparith.inc mpsr_Tok.inc
372
373cntrlc.o cntrlc.og : feOptES.inc feOptTS.inc feOpt.inc version.h
374
375misc_ip.o emacs.o tesths.o: version.h
376
377claptmpl.o: claptmpl.cc mod2.h
378        ${CXX} ${CXXFLAGS}  ${CPPFLAGS} ${DEFS} -c $<
379
380iparith.inc: claptmpl.o iparith.cc \
381                          ipconv.cc tok.h mpsr_Tok.cc grammar.h mod2.h
382        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} -DGENTABLE \
383             -o gentable1 claptmpl.o iparith.cc tesths.cc mpsr_Tok.cc \
384             ${OBJS} ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o
385        ./gentable1
386        /bin/rm -f gentable1 gentable1.exe
387
388mpsr_Tok.inc: claptmpl.o iparith.cc \
389                          ipconv.cc tok.h mpsr_Tok.cc grammar.h mod2.h
390        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} -DGENTABLE \
391             -o gentable2 claptmpl.o iparith.cc tesths.cc mpsr_Tok.cc \
392             ${OBJS} ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o
393        ./gentable2
394        /bin/rm -f gentable2 gentable2.exe
395
396
397version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in \
398           configure.in
399        echo "#define feVersionId "  `date '+%Y%m%d%H'` >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) -DGENTABLE ${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.