source: git/Singular/Makefile.in @ 0d348b

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