source: git/Singular/Makefile.in @ 12a9ac

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