source: git/Singular/Makefile.in @ 53f204

spielwiese
Last change on this file since 53f204 was 53f204, checked in by Hans Schoenemann <hannes@…>, 14 years ago
tr 241 git-svn-id: file:///usr/local/Singular/svn/trunk@12981 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 22.4 KB
RevLine 
[f0fd47]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 \
[8d38c87]176    cntrlc.cc misc_ip.cc \
[f0fd47]177    calcSVD.cc \
178    Minor.cc \
179    MinorProcessor.cc \
[150e5d]180    MinorInterface.cc
[f0fd47]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
368
369claptmpl.o: claptmpl.cc mod2.h
370        ${CXX} ${CXXFLAGS}  ${CPPFLAGS} ${DEFS} -c $<
371
[53f204]372iparith.inc: claptmpl.o iparith.cc \
[f0fd47]373                          ipconv.cc tok.h mpsr_Tok.cc grammar.h mod2.h
374        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} -DGENTABLE \
[53f204]375             -o gentable1 claptmpl.o iparith.cc tesths.cc mpsr_Tok.cc \
[f0fd47]376             ${OBJS} ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o
[53f204]377        ./gentable1
378        /bin/rm -f gentable1 gentable1.exe
379
380mpsr_Tok.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 gentable2 claptmpl.o iparith.cc tesths.cc mpsr_Tok.cc \
384             ${OBJS} ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o
385        ./gentable2
386        /bin/rm -f gentable2 gentable2.exe
[f0fd47]387
388
389version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in \
390           configure.in
391        echo "#define feVersionId "  `date '+%Y%m%d%H'` >version.h
392        echo "#define CC \"" ${CC} ${CFLAGS} ${DEFS}"\"" >>version.h
393        echo "#define CXX \"" ${CXX} ${CXXFLAGS} ${DEFS} "\"" >>version.h
394
395libparse: libparse_main.o utils.o
396        ${CXX}  ${CPPFLAGS} -DSTANDALONE_PARSER -o libparse libparse_main.o utils.o ../kernel/fegetopt.o ${LDFLAGS2} -lomalloc
397
398libparse_main.o: libparse.cc
399        ${CXX} ${CPPFLAGS} -c -o libparse_main.o libparse.cc  -DSTANDALONE_PARSER
400
401utils.o: utils.cc
402        ${CXX} ${CPPFLAGS} -c -o utils.o utils.cc  -DSTANDALONE_PARSER
403
404libparse.cc: libparse.l
405        @if test "x${LEX}" = x; then \
406                echo Error: no lex given, could not rebuilt libparse.cc;\
407                exit 1; \
408        fi
409        ${LEX} -I -Pyylp -t libparse.l >libparse.cc.lmp
410        cp libparse.cc.lmp libparse.cc
411
412# Hmm compiling with -fomit-frame-pointer resulted in access violation
413# under cygwin
414ESingular: mod2.h feOpt.cc version.h emacs.cc \
415           feOptES.inc
416        ${CXX} -O2 ${CPPFLAGS} ${DEFS} -DESINGULAR -DPROTO -o ESingular emacs.cc ../kernel/fegetopt.o \
417        ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o
418
419TSingular: mod2.h feOpt.cc version.h emacs.cc \
420           feOptTS.inc
421        ${CXX} -O2 ${CPPFLAGS} ${DEFS} -DTSINGULAR -DPROTO -o TSingular emacs.cc ../kernel/fegetopt.o \
422        ${LDFLAGS} ${LIBS} ../kernel/mmalloc.o
423
424feOpt.o: feOpt.inc feOptES.inc feOptTS.inc
425extra.o: feOpt.inc
426
[44a092]427feOptTS.inc feOptES.inc feOpt.inc: feOpt.cc mod2.h
428        $(CXX) -DGENERATE_OPTION_INDEX -I../kernel feOpt.cc -o feOpt.xx && mv feOpt.xx feOpt
[f0fd47]429        ./feOpt
430        /bin/rm -f feOpt feOpt.exe
[44a092]431        $(CXX) -DGENERATE_OPTION_INDEX  -DESINGULAR -I../kernel feOpt.cc -o feOptES.xx && mv feOptES.xx feOptES
[70881f7]432        ./feOptES
433        rm -f feOptES feOptES.exe
[44a092]434        $(CXX) -DGENERATE_OPTION_INDEX  -DTSINGULAR -I../kernel feOpt.cc -o feOptTS.xx && mv feOptTS.xx feOptTS
[70881f7]435        ./feOptTS
436        rm -f feOptTS feOptTS.exe
[f0fd47]437
438mpsr.so: $(MPSR_SOURCES:.cc=.dl_o)
439        $(LD) ${SLDFLAGS} -o $@ $^ -L${libdir} ${MP_LIBS} ${GLIBC_DYN_FIX}
440
441dbmsr.so: $(DBMSR_SOURCES:.cc=.dl_o)
442        $(LD) ${SLDFLAGS} -o $@ $^ ${GLIBC_DYN_FIX}
443
444src: scanner.cc grammar.h grammar.cc libparse.cc
445
446mod2.h: stamp-h
447
448stamp-h : config.status mod2.h.in
449        CONFIG_FILES= CONFIG_HEADERS="mod2.h" ./config.status
450
451Makefile: Makefile.in config.status
452        CONFIG_FILES="Makefile" CONFIG_HEADERS= ./config.status
453
454config.status: configure
455        ./config.status --recheck
456
457configure: configure.in
458        @echo "WARNING: You need to rerun autoconf. I am proceeding, for now."
459        @touch configure
460#       autoconf
461
462ifeq ($(SINGUNAME),ix86-Win)
463##
464## windows only targets
465##
466
467## resources
468Singular.rc: Singular.rc.in config.status
469        CONFIG_FILES="Singular.rc" CONFIG_HEADERS= ./config.status
470
471ESingular_res.o: Singular.rc
472        windres -DESINGULAR -i Singular.rc -o ESingular_res.o
473
474TSingular_res.o: Singular.rc
475        windres -DTSINGULAR -i Singular.rc -o TSingular_res.o
476
477Singular_res.o: Singular.rc
478        windres -DSINGULAR -i Singular.rc -o Singular_res.o
479
480## run
481run.o: run.c run.h
482        gcc -c -I. -O2 run.c -o run.o
483
484runTSingular : run.o TSingular_res.o
485        gcc -mwindows run.o TSingular_res.o -o runTSingular.exe
486#       gcc -mwindows -e _mainCRTStartup run.o TSingular_res.o -o runTSingular.exe
487
488runESingular : run.o ESingular_res.o
489        gcc -mwindows run.o ESingular_res.o -o runESingular.exe
490#       gcc -mwindows -e _mainCRTStartup run.o ESingular_res.o -o runESingular.exe
491
492RUN_SINGULARS=runESingular runTSingular
493
494endif
495
496##
497## install targets
498##
499install: all installbin installslib
500
501install_all: install
502
503install-nolns: all installbin-nolns installslib-nolns
504
505installbin: ${SING_EXEC} libparse ESingular TSingular ${RUN_SINGULARS}
506        ${MKINSTALLDIRS} ${bindir}
507        ${INSTALL_PROGRAM} ${SING_EXEC} ${SINGULAR}
508        -for file in *.so; do \
509          ${INSTALL_PROGRAM} $$file ${bindir}; \
510        done
511        ${INSTALL_PROGRAM} libparse ${RUN_SINGULARS} ${bindir}
512        ${INSTALL_PROGRAM} ESingular TSingular ${bindir}
513        ${INSTALL_PROGRAM} surfex ${bindir}
514        chmod a+x ${SINGULAR}
515        rm -f ${bindir}/${SING_EXEC}${EXEC_EXT}
516        cd ${bindir}; ${LN_S} ${SINGULAR} Singular${EXEC_EXT};
517
518installbin-nolns: ${SING_EXEC} libparse ESingular TSingular ${RUN_SINGULARS}
519        ${MKINSTALLDIRS} ${bindir}
520        ${INSTALL_PROGRAM} ${SING_EXEC} ${SINGULAR}
521        -for file in *.so; do \
522          ${INSTALL_PROGRAM} $$file ${bindir}; \
523        done
524        ${INSTALL_PROGRAM} libparse ${RUN_SINGULARS} ${bindir}
525        ${INSTALL_PROGRAM} ESingular TSingular ${DL_LIBS} ${bindir}
526        chmod a+x ${SINGULAR}
527        rm -f ${bindir}/${SING_EXEC}${EXEC_EXT}
528        ${INSTALL_PROGRAM} ${SINGULAR} ${bindir}/Singular${EXEC_EXT};
529
530installslib: LIB
531        test -r ${slibdir} || ${LN_S} `pwd`/LIB ${slibdir}
532
533installslib-nolns: LIB
534        ${MKINSTALLDIRS} ${slibdir}
535        for file in `pwd`/LIB/*.lib; do \
536          ${INSTALL_DATA}  $$file ${slibdir}; \
537        done
538        ${MKINSTALLDIRS} ${slibdir}/gftables
539        ${INSTALL_DATA} `pwd`/LIB/gftables/* ${slibdir}/gftables/
540
541install-libsingular: libsingular
542        ${MKINSTALLDIRS} ${includedir}/singular
543        for file in *.$(SO_SUFFIX); do \
544          ${INSTALL_PROGRAM}  $$file ${libdir}; \
545        done
546        ${INSTALL_PROGRAM} libsingular.h ${includedir}
547        ${INSTALL_PROGRAM} subexpr.h ${includedir}/singular
548        ${INSTALL_PROGRAM} tok.h ${includedir}/singular
549        ${INSTALL_PROGRAM} grammar.h ${includedir}/singular
550        ${INSTALL_PROGRAM} ipid.h ${includedir}/singular
551        ${INSTALL_PROGRAM} ipshell.h ${includedir}/singular
552        ${INSTALL_PROGRAM} lists.h ${includedir}/singular
553        ${INSTALL_PROGRAM} attrib.h ${includedir}/singular
554
555uninstall: uninstallbin
556
557uninstallbin:
558        rm -f ${bindir}/Singular${EXEC_EXT}
559        rm -f ${SINGULAR}
560        -rmdir ${bindir}
561
562##
563## clean targest
564##
565mostlyclean:
566        -rm -f Singular Singular-static Singularg Singularp libparse feOpt*.inc
567        -rm -f *.o *.og core *.op *.so* *.dl_o*
568        -rm -f ESingular* TSingular*
569
570clean: mostlyclean
571        -rm -f *.bak *.d *.dd depend
572        -rm -f ${slibdir}
573
574distclean: clean
575        -rm -f iparith.inc mpsr_Tok.inc stamp.h
576        -rm -f Singular* *.gprof *.bprof *~ .\#* version.h
577        rm -f plural_cmd.inc
578        -rm -f mod2.h Makefile TAGS* tags config.status config.cache config.log
579
580srcclean:
581        @echo "This command is intended for maintainers to use;"
582        @echo "Rebuilding the deleted files requires flex"
583        @echo "bison, perl"
584        -rm -f scanner.cc grammar.h grammar.cc libparse.cc
585
586maintainer-clean: distclean srcclean
587        @echo "This command is intended for maintainers to use;"
588        @echo "Rebuilding the deleted files requires flex"
589        @echo "bison, perl and autoconf"
590        -rm configure
591
592##
593## miscellanous targets
594##
[12a9ac]595fehelp.o fehelp.og fehelp.op: feOpt.inc
596
[f0fd47]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}
[6184b1]605        ${INSTALL_PROGRAM} ${SING_EXEC} ${install_bindir}/Singular
[f0fd47]606        -${INSTALL_PROGRAM} *.so ${install_bindir}
[69b4990]607        ${INSTALL_PROGRAM} -s  libparse ${RUN_SINGULARS} ESingular TSingular ${install_bindir}
[f0fd47]608        ${INSTALL_PROGRAM} surfex ${install_bindir}
609        echo "#undef MAKE_DISTRIBUTION " > distrib.h
610
611install-sharedist: ${SLIBS_FILES} LIB/gftables
612        ${MKINSTALLDIRS} ${install_slibdir}
613        cp ${SLIBS_FILES} ${install_slibdir}
614        ${MKINSTALLDIRS} ${install_slibdir}/gftables
615        cp ${GFTABLES} ${install_slibdir}/gftables
616        ${MKINSTALLDIRS} ${install_slibdir}/surfex
617        cp LIB/surfex/surfex.jar ${install_slibdir}/surfex
618        chmod -R +rX ${install_slibdir}/*
619
620tar:
621        tar cf Singular-${SINGULAR_VERSION}-src.tar ${DISTFILES}
622        gzip -f Singular-${SINGULAR_VERSION}-src.tar
623
624backup: tar
625        mcopy -o Singular-${SINGULAR_VERSION}-src.tar.gz a:
626
627TAGS:   ${SOURCES} ${ESOURCES} ${HEADERS}
628        etags ${SOURCES} ${ESOURCES} ${HEADERS} ../kernel/*.[ch] ../kernel/*.cc ../kernel/*.inc
629
630
631tags:   
632        ctags *.y *.[lch] *.cc *.inc ../kernel/*.[ch] ../kernel/*.cc ../kernel/*.inc
633
634echoLIBS:
635        @echo ${SLIBS}
636
637##
638## Below here is stuff for developpers
639#################################################################
640
641
642##
643## .og files for having -O and -g object versions available at the same time
644##
645
646OBJG1 := $(CXXSOURCES:.cc=.og)
647OBJG2 := $(CSOURCES:.c=.og)
648
649OBJG=$(OBJG1) $(OBJG2)
650
651DL_TAILG=\"sog\"
652
653
654ifeq ($(DL_KERNEL),1)
655
656OBJG := $(OBJG) $(DL_KERNEL_SOURCES:.cc=.og)
657DL_LIBSG := $(MPSR_SO:%.so=%.sog) $(DBMSR_SO:%.so=%.sog)
658
659else
660
661OBJG := $(OBJG) $(STATIC_SOURCES:.cc=.og) $(COMMON_SOURCES:.cc=.og)
662DL_LIBSG=
663
664endif
665
666
667##
668## compiler and linker options for debug version
669##
670
671CCG             = ${CC}
672CXXG            = ${CXX}
673CXXM            = gcc -MM -MG -DGENERATE_DEPEND
674CCM             = gcc -MM -MG -DGENERATE_DEPEND
675
676CFLAGSG         = -g -Wall -Wno-unused ${PIPE}
677CXXFLAGSG       = -g -Wall -Wno-unused ${PIPE}
678CXXTEMPLFLAGSG  = -fno-implicit-templates
679DEFSG           = -D@SING_UNAME@ @DEFS@ -DDL_TAIL=$(DL_TAILG)
680
681##
682## Debug Targets
683##
684
685%.dl_og: %.cc
686        ${CXXG} ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} ${SFLAGS} -c $< -o $@
687
688mpsr.sog: $(MPSR_SOURCES:.cc=.dl_og)
689        ${CXXG} ${CXXFLAGSG} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS} ${GLIBC_DYN_FIX}
690
691dbmsr.sog: $(DBMSR_SOURCES:.cc=.dl_og)
692        ${CXXG} ${CXXFLAGSG} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS}
693
694claptmpl.og: claptmpl.cc mod2.h
695        $(CXXG)  ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
696
697%.og: %.cc
698        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
699
700$(OBJG2) : %.og: %.c
701        $(CCG)  ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
702
703Singularg${S_EXT}: scanner.cc  $(OBJG)  $(DL_LIBSG)\
704           iparith.og mpsr_Tok.og claptmpl.og tesths.cc version.h
705        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -o Singularg${S_EXT} \
706        tesths.cc iparith.og mpsr_Tok.og claptmpl.og $(OBJG) ${LDFLAGSG} ${LIBSG} -lomalloc ../kernel/mmalloc.og \
707        ${LD_DYN_FLAGS} ${LD_LIBC}
708
709iparith.og: iparith.inc iparith.cc
710        $(CXXG)  ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c iparith.cc -o iparith.og
711
712mpsr_Tok.og: iparith.inc mpsr_Tok.cc
713        $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${CXXTEMPLFLAGSG} ${DEFSG} -c mpsr_Tok.cc -o mpsr_Tok.og
714
715installg: Singularg
716        ${MKINSTALLDIRS} ${bindir}
717        ${INSTALL_PROGRAM} Singularg ${bindir} 
718
719ESingularg: mod2.h feOpt.cc version.h emacs.cc \
720           feOptES.inc
721        ${CXXG} ${CXXFLAGSG} ${CPPFLAGS} -DESINGULAR -g ${DEFSG} -o ESingularg emacs.cc ../kernel/fegetopt.og ${LDFLAGS} ${LIBS} -lomalloc ../kernel/mmalloc.og
722
723##
724## .op files for having -O and -g pg object versions available at the same time
725##
726
727OBJP1 := $(CXXSOURCES:.cc=.op)
728OBJP2 := $(CSOURCES:.c=.op)
729
730OBJP=$(OBJP1) $(OBJP2)
731
732DL_TAILP=\"sop\"
733
734
735ifeq ($(DL_KERNEL),1)
736
737OBJP := $(OBJP) $(DL_KERNEL_SOURCES:.cc=.op)
738DL_LIBSP := $(MPSR_SO:%.so=%.sop) $(DBMSR_SO:%.so=%.sop)
739
740else
741
742OBJP := $(OBJP) $(STATIC_SOURCES:.cc=.op) $(COMMON_SOURCES:.cc=.op)
743DL_LIBSP=
744
745endif
746
747
748##
749## compiler and linker options for profiling version
750##
751
752CCP             = ${CC}
753CXXP            = ${CXX}
754
755CFLAGSP         = -g -pg -O -Wall -Wno-unused ${PIPE}
[283d86]756CXXFLAGSP       = -g -pg -O -Wall -Wno-unused ${PIPE}
[f0fd47]757CXXTEMPLFLAGSP  = -fno-implicit-templates
758DEFSP           = -D@SING_UNAME@ @DEFS@ -DDL_TAIL=$(DL_TAILP)
759
760##
761## Profiling Targets
762##
763
764%.dl_op: %.cc
765        ${CXXP} ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} ${SFLAGS} -c $< -o $@
766
767mpsr.sop: $(MPSR_SOURCES:.cc=.dl_op)
768        ${CXXP} ${CXXFLAGSP} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS} ${GLIBC_DYN_FIX}
769
770dbmsr.sop: $(DBMSR_SOURCES:.cc=.dl_op)
771        ${CXXP} ${CXXFLAGSP} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS}
772
773claptmpl.op: claptmpl.cc mod2.h
774        $(CXXP)  ${CXXFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@
775
776%.op: %.cc
777        $(CXXP) ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@
778
779$(OBJP2) : %.op: %.c
780        $(CCP)  ${CFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@
781
782Singularp${S_EXT}: scanner.cc  $(OBJP)  $(DL_LIBSP)\
783           iparith.op mpsr_Tok.op claptmpl.op tesths.cc version.h
784        (cd ../kernel;make libkernel_p.a;make install;cd ../Singular)
785        $(CXXP) ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} -o Singularp${S_EXT} \
[0592f7]786        tesths.cc iparith.op mpsr_Tok.op claptmpl.op $(OBJP) ${LDFLAGSP} ${LIBSP} -lomalloc ../kernel/mmalloc.op \
[f0fd47]787        ${LD_DYN_FLAGS} ${LD_LIBC}
788
789iparith.op: iparith.inc iparith.cc
790        $(CXXP)  ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} -c iparith.cc -o iparith.op
791
792mpsr_Tok.op: iparith.inc mpsr_Tok.cc
793        $(CXXP) ${CXXFLAGSP} ${CPPFLAGS} ${CXXTEMPLFLAGSP} ${DEFSP} -c mpsr_Tok.cc -o mpsr_Tok.op
794
795installp: Singularp
796        ${MKINSTALLDIRS} ${bindir}
797        ${INSTALL_PROGRAM} Singularp ${bindir} 
798
799##
800## dependencies
801##
802
803%.dd: %.cc mod2.h
804        echo $(@:.dd=.og) $(@:.dd=.op) $(@:.dd=.dl_o) $(@:.dd=.dl_og)  $(@:.dd=.dl_op)" " \\ > $@
805        $(CXXM) -DGENTABLE ${CPPFLAGS} ${DEFSG} $< >> $@
806
807%.d: %.c mod2.h
808        echo $(@:.d=.og) $(@:.d=.op)" " \\ > $@
809        $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@
810
811depend:   $(CXXSOURCES:.cc=.dd) $(ESOURCES:.cc=.dd) $(CSOURCES:.c=.d) mod2.h claptmpl.dd
812        -cat *.dd >depend
813
814ifeq (depend,$(wildcard depend))
815include depend
816endif
817
818
Note: See TracBrowser for help on using the repository browser.