source: git/Singular/Makefile.in @ 4082e8

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