source: git/Singular/Makefile.in @ 283d86

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