source: git/Singular/Makefile.in @ f2c53c0

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