source: git/Singular/Makefile.in @ 17b33e

fieker-DuValspielwiese
Last change on this file since 17b33e was 17b33e, checked in by Hans Schönemann <hannes@…>, 19 years ago
*hannes: libns renamed git-svn-id: file:///usr/local/Singular/svn/trunk@8346 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 18.5 KB
RevLine 
[2f5b71]1################################################################
[5f9072]2###
3### Makefile for Singular
4###
5#################################################################
6
7SHELL           = /bin/sh
8
9##
[64c6d1]10## version
[5f9072]11##
[64c6d1]12SINGULAR_VERSION        = @SINGULAR_VERSION@
13SINGULAR                = @SINGULAR@
[d439f7]14SINGUNAME               = @SINGUNAME@
[a70441f]15EXEC_EXT                = @EXEC_EXT@
[0513d8]16HAVE_PLURAL             = @PLURAL@
[d439f7]17##
[5f9072]18## various paths
19##
20srcdir          = @srcdir@
21prefix          = @prefix@
22exec_prefix     = @exec_prefix@
23libdir          = @libdir@
[dc87554]24# program executable goes here
25bindir          = @bindir@
[64c6d1]26# includes are taken from here
[5f9072]27includedir      = @includedir@
[460c1e1]28slibdir         = ${prefix}/LIB
[4b72f6]29install_bindir  = ${install_prefix}/${SINGUNAME}
30install_slibdir = ${install_prefix}/LIB
[5f9072]31
[d439f7]32##
[5f9072]33## various programs
34##
[64c6d1]35@SET_MAKE@
[5f9072]36CC              = @CC@
[50cbdc]37LD              = @LD@
[5f9072]38CXX             = @CXX@
[ec4fe3]39LEX             = sh flexer.sh
[a70441f]40PERL            = @PERL@
[f7b5a1]41BISON           = bison
[ef0124]42INSTALL         = @INSTALL@
43INSTALL_PROGRAM = @INSTALL_PROGRAM@
44INSTALL_DATA    = @INSTALL_DATA@
[63eab7]45MKINSTALLDIRS   = ./mkinstalldirs
[64c6d1]46LN_S            = @LN_S@
[5f9072]47
48##
49## compiler and linker options
50##
[64c6d1]51PIPE            = @PIPE@
[d439f7]52CFLAGS          = @CFLAGS@ ${PIPE}
53CXXFLAGS        = @CXXFLAGS@ ${PIPE}
[5f9072]54CXXTEMPLFLAGS   = @CXXTEMPLFLAGS@
[2f5b71]55CPPFLAGS        = -I${srcdir} -I../kernel @CPPFLAGS@
[c232af]56DEFS            = -DNDEBUG -DOM_NDEBUG -D@SING_UNAME@ @DEFS@
[08df49]57LDFLAGS2        = @LDFLAGS@
[2f5b71]58LDFLAGS         = -L../kernel -lkernel @LDFLAGS@
59LDFLAGSG        = -L../kernel -lkernel-g @LDFLAGS@
[73aa5e]60LD_DYN_FLAGS    = @LD_DYN_FLAGS@
[7e5a38]61SFLAGS          = @SFLAGS@
62SLDFLAGS        = @SLDFLAGS@
63
[bd3d4e]64LD_LIBC         = -lc
[dbf92f]65STATIC_LDFLAGS  = @STATIC_LDFLAGS@
[f8dcbcb]66# under cygwin, do not explicitly link against -lm, for it is the cygwin
67# lib -- if you really want to do this, use -lm as the _last_ thing on the
68# arguments to link
69ifneq ($(SINGUNAME),ix86-Win)
[c232af]70LIBS            = -lm @NEED_LIBS@
[f8dcbcb]71else
[0c7cb8]72LIBS            = -lsingfac -lsingcf -lntl -lgmp -static -lreadline -lncurses
[f8dcbcb]73endif
[6b32990]74MP_LIBS         = @MP_LIBS@
[7e5a38]75DL_KERNEL       = @DL_KERNEL@
[6b32990]76HAVE_MPSR       = @HAVE_MPSR@
[05fc79]77
[91f288]78ifdef LD_STATIC
79LDFLAGS  := ${STATIC_LDFLAGS} ${LDFLAGS}
80SING_EXEC = Singular-static
[6b32990]81LIBS := ${MP_LIBS} ${LIBS}
[7e5a38]82DL_KERNEL =
[91f288]83else
[bd3d4e]84LDFLAGS  := ${LD_DYN_FLAGS} ${LDFLAGS}
[91f288]85SING_EXEC = Singular
86endif
87
[6b32990]88# CXXFLAGS =  -g -Wall -Wno-unused
89# CFLAGS =  -g -Wall -Wno-unused
[5f9072]90##
91## End configuration dependend stuff
92#################################################################
93
[f7b5a1]94###
95### file sets
96###
97
[c06a32]98# normal C++ source files
[cb25d3e]99CXXSOURCES=grammar.cc scanner.cc attrib.cc \
[76b4bd]100    eigenval_ip.cc\
[aa3877a]101    extra.cc fehelp.cc feOpt.cc \
[5f9072]102    ipassign.cc ipconv.cc ipid.cc iplib.cc \
[2f5b71]103    ipprint.cc ipshell.cc \
104    lists.cc \
[cb25d3e]105    sdb.cc \
[2f5b71]106    fglm.cc \
[cb25d3e]107    silink.cc \
108    subexpr.cc \
109    janet.cc wrapper.cc\
[2f5b71]110    libparse.cc sing_win.cc\
111    gms.cc pcv.cc maps_ip.cc\
[22cff0]112    walk.cc walk_ip.cc \
[6aef6f2]113    pShallowCopyDelete.cc cntrlc.cc misc.cc
[b7b08c]114
[6b32990]115# stuff for MP
116MPSR_SOURCES = mpsr_Put.cc mpsr_PutPoly.cc mpsr_GetPoly.cc mpsr_sl.cc\
117        mpsr_Get.cc mpsr_GetMisc.cc mpsr_Error.cc \
118
[2f436b]119
[6b32990]120# stuff for dbm
121DBMSR_SOURCES =  ndbm.cc sing_dbm.cc
122
[c06a32]123# normal C source files
[41c6ce]124CSOURCES=
[5f9072]125
[7e5a38]126# C++ sources which are used if part of the kernel are dynamically linked
[2f5b71]127DL_KERNEL_SOURCES=slInit_Dynamic.cc
[7e5a38]128
129# C++ sources which are used for dynamic libraries if part of the kernel is
130# dynamically linked
[2f5b71]131DL_LIB_SOURCES=
[7e5a38]132
133# C++ sources which are used if no parts of the kernel are dynamically linked
[2f5b71]134STATIC_SOURCES=slInit_Static.cc
[6b32990]135
136# C++ sources for which both, shared and static object files are needed
137COMMON_SOURCES = $(MPSR_SOURCES) $(DBMSR_SOURCES)
[7e5a38]138
139# special C++ source files (need extra compiling and/or linking), for which
140# dependencies should be generated
[59d417]141ESOURCES=iparith.cc $(COMMON_SOURCES) \
[6b32990]142        $(DL_KERNEL_SOURCES) $(DL_LIB_SOURCES) $(STATIC_SOURCES)
[7e5a38]143
[6b32990]144SOURCES=${CSOURCES} ${CXXSOURCES} \
[666c90]145        grammar.y scanner.l libparse.l \
[50cbdc]146        p_Delete__T.cc p_ShallowCopyDelete__T.cc \
147        p_Copy__T.cc p_Mult_nn__T.cc  pp_Mult_nn__T.cc \
148        pp_Mult_mm__T.cc p_Mult_mm__T.cc \
149        p_Minus_mm_Mult_qq__T.cc p_Add_q__T.cc \
150        p_Neg__T.cc pp_Mult_Coeff_mm_DivSelect__T.cc \
151        pp_Mult_Coeff_mm_DivSelectMult__T.cc \
152        p_Merge_q__T.cc pp_Mult_mm_Noether__T.cc\
153        p_kBucketSetLm__T.cc \
[fdd985e]154        kInline.cc utils.cc utils.h \
[7e5a38]155        tesths.cc mpsr_Tok.cc claptmpl.cc
[5f9072]156
[2f5b71]157HEADERS=lists.h attrib.h \
158        mpsr_Tok.h \
159        ipconv.h \
160        subexpr.h ipid.h \
[41c6ce]161        cntrlc.h ipprint.h sdb.h \
[2f5b71]162        ipshell.h tok.h \
163        silink.h \
[c0eb11]164        fglm.h sing_dbm.h maps_ip.h \
[2f5b71]165        mpsr.h mpsr_sl.h\
166        mpsr_Get.h kmatrix.h janet.h\
[fc5095]167        mpsr_Put.h walk.h\
[2f5b71]168        dbm_sl.h libparse.h \
[76b4bd]169        gms.h pcv.h eigenval_ip.h \
[416465]170        feOpt.h fegetopt.h distrib.h walk.h \
[2f5b71]171        static.h\
172        omSingularConfig.h
[5f9072]173
[2f436b]174DISTFILES=${SOURCES} ${HEADERS} ${ESOURCES} \
175        Makefile.in configure.in configure \
[9c35ef]176        mod2.h.in grammar.h testgh install-sh mkinstalldirs \
[666c90]177        check_aso.pl
[5f9072]178
[c06a32]179OBJS := $(CXXSOURCES:.cc=.o) $(CSOURCES:.c=.o)
[5f9072]180
[8654b5]181ifeq ($(SINGUNAME),ix86-Win)
182OBJS := $(OBJS) Singular_res.o
183endif
184
[6b32990]185P_PROCS_MODULES = FieldZp FieldIndep FieldQ FieldGeneral
186
[7e5a38]187ifeq ($(DL_KERNEL),1)
[6b32990]188OBJS    := $(OBJS) $(DL_KERNEL_SOURCES:.cc=.o)
189DBMSR_SO= dbmsr.so
[2f5b71]190DL_LIBS := $(DBMSR_SO)
[6b32990]191ifeq ($(HAVE_MPSR), 1)
192MPSR_SO =       mpsr.so
193DL_LIBS :=      $(DL_LIBS) $(MPSR_SO)
194endif
[7e5a38]195else
[6b32990]196ifndef LD_STATIC
197LIBS := $(MP_LIBS) $(LIBS)
198endif
[a3abdb]199OBJS := $(OBJS) $(STATIC_SOURCES:.cc=.o) $(COMMON_SOURCES:.cc=.o)
[7e5a38]200DL_LIBS=
201endif
202
[4b72f6]203#
[58c9f6]204# Singular libraries which go into distribution
[4b72f6]205# MAKE SURE THAT THIS IS UP_TO_DATE
206#
[bbad78]207
[0513d8]208SLIB0 = COPYING \
[550d70]209        ainvar.lib   alexpoly.lib  algebra.lib   all.lib       brnoeth.lib \
[eb9e69]210        classify.lib control.lib   deform.lib    elim.lib      equising.lib \
211        finvar.lib   gmspoly.lib   gmssing.lib   general.lib   graphics.lib \
212        grwalk.lib   groups.lib    hnoether.lib  homolog.lib   inout.lib \
213        intprog.lib  latex.lib     linalg.lib    lll.lib       makedbm.lib \
[bbfc8ce]214        matrix.lib   mprimdec.lib  mondromy.lib  mregular.lib  rootsmr.lib \
215        normal.lib   ntsolve.lib  \
[eb9e69]216        poly.lib     presolve.lib  primdec.lib   primitiv.lib   qhmoduli.lib \
[17b33e]217        random.lib   reesclos.lib  resolve.lib   resgraph.lib   reszeta.lib \
218        ring.lib     rinvar.lib    sagbi.lib     sheafcoh.lib   sing.lib \
[eb9e69]219        solve.lib    signcond.lib  spcurve.lib   spectrum.lib   standard.lib \
220        stratify.lib surf.lib      toric.lib     triang.lib     rootsur.lib \
[17b33e]221        zeroset.lib  help.cnf
[550d70]222 
[4b72f6]223
[17b33e]224PLIBS = center.lib gkdim.lib involut.lib ncall.lib ncalg.lib ncdecomp.lib nctools.lib qmatrix.lib
[643fbb]225
[0513d8]226ifdef HAVE_PLURAL
227SLIBS = ${SLIB0} ${PLIBS}
228else
229SLIBS = ${SLIB0}
230endif
[4b72f6]231
[0513d8]232SLIBS_FILES = $(addprefix LIB/,${SLIBS})
[643fbb]233
[4b72f6]234GFTABLES = $(wildcard LIB/gftables/[1-9]*)
[58c9f6]235
[5f9072]236##
[64c6d1]237## Build Targets
[5f9072]238##
239.l.cc:
[64c6d1]240        @if test "x${LEX}" = x; then \
241                echo Error: no lex given, could not rebuilt scanner.cc;\
242                exit 1; \
[f92fa13]243        fi
[ec4fe3]244        ${LEX} -s -I -t $< > scanner.cc.lmp
245        cp scanner.cc.lmp scanner.cc
246
[5f9072]247.y.cc:
[64c6d1]248        @if test "x${BISON}" = x; then \
[ae35b67]249                echo Error: no bison given, could not rebuilt grammar.cc;\
[64c6d1]250                exit 1; \
251        fi
[5f9072]252        ${BISON} -d -t -o grammar.cc $<
[58b151c]253        chmod +x testgh
[5f9072]254        ./testgh
255
256.cc.o: 
257        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} -c $<
258.c.o:
259        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $<
260
[ba2047]261%.dl_o : %.cc
262        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} ${SFLAGS} -c $< -o $@
263
[0fc04d]264all:    $(SING_EXEC)
[f7b5a1]265
[6b32990]266Singular-static: version.h
[f4d659]267        sleep 1
[67fb84]268        echo "#define HAVE_STATIC" > static.h
[fd19918]269        (cd ../kernel;${MAKE} LD_STATIC=1 install-bindist;cd ..//Singular)
[6b32990]270        ${MAKE} LD_STATIC=1 S_EXT="-static" Singular-static
[7e5a38]271        echo "#undef HAVE_STATIC" > static.h
[bd3d4e]272
[59d417]273Singular${S_EXT}: mod2.h Makefile version.h scanner.cc  ${OBJS} \
[7e5a38]274          iparith.o tesths.cc libparse.cc claptmpl.o mpsr_Tok.o $(DL_LIBS)
[c06a32]275        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} \
[6b32990]276          -o Singular${S_EXT} \
[c06a32]277          tesths.cc iparith.o mpsr_Tok.o claptmpl.o\
[59d417]278          ${OBJS} ${LDFLAGS} ${LIBS} -lomalloc_ndebug ../kernel/mmalloc.o
[5f9072]279
[7e5a38]280%.static: version.h
[6b32990]281        ${MAKE} DL_KERNEL=0 S_EXT=".static" $@
[7e5a38]282
[dc32d42]283iparith.o mpsr_Tok.o : iparith.inc mpsr_Tok.inc
[5f9072]284
[5cfef2]285cntrlc.o cntrlc.og : feOptES.inc feOptTS.inc feOpt.inc
286
[5f9072]287claptmpl.o: claptmpl.cc mod2.h
288        ${CXX} ${CXXFLAGS}  ${CPPFLAGS} ${DEFS} -c $<   
[dc32d42]289
[59d417]290iparith.inc mpsr_Tok.inc: claptmpl.o iparith.cc \
[c06a32]291                          ipconv.cc tok.h mpsr_Tok.cc grammar.h mod2.h
[7df4ee]292        ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${CXXTEMPLFLAGS} ${DEFS} -DGENTABLE \
[c06a32]293             -o gentable claptmpl.o iparith.cc tesths.cc mpsr_Tok.cc \
[59d417]294             ${OBJS} ${LDFLAGS} ${LIBS} -lomalloc_ndebug ../kernel/mmalloc.o
[64c6d1]295        ./gentable
296        /bin/rm -f gentable gentable.exe
[5f9072]297
[6a51ef]298
[9c35ef]299version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in \
[744d1ce]300           configure.in
[a3705ae]301        echo "#define feVersionId "  `date '+%Y%m%d%H'` >version.h
[70c508]302        echo "#define CC \"" ${CC} ${CFLAGS} "\"" >>version.h
303        echo "#define CXX \"" ${CXX} ${CXXFLAGS} "\"" >>version.h
[5f9072]304
[f51b9c]305libparse: libparse_main.o utils.o fegetopt.o
[08df49]306        ${CXX}  ${CPPFLAGS} -DSTANDALONE_PARSER -o libparse libparse_main.o utils.o fegetopt.o ${LDFLAGS2} -lomalloc_ndebug
[f92fa13]307
308libparse_main.o: libparse.cc
[f51b9c]309        ${CXX} ${CPPFLAGS} -c -o libparse_main.o libparse.cc  -DSTANDALONE_PARSER
[f92fa13]310
311libparse.cc: libparse.l
[64c6d1]312        @if test "x${LEX}" = x; then \
313                echo Error: no lex given, could not rebuilt libparse.cc;\
314                exit 1; \
[f92fa13]315        fi
[ec4fe3]316        ${LEX} -I -Pyylp -t libparse.l >libparse.cc.lmp
317        cp libparse.cc.lmp libparse.cc
[64c6d1]318
[ef0124]319# Hmm compiling with -fomit-frame-pointer resulted in access violation
320# under cygwin
[aa3877a]321ESingular: fegetopt.o mod2.h feOpt.cc version.h emacs.cc \
[59d417]322           feOptES.inc
[c232af]323        ${CXX} -O2 ${CPPFLAGS} ${DEFS} -DESINGULAR -o ESingular emacs.cc fegetopt.o \
[59d417]324        ${LDFLAGS} -lomalloc_ndebug ../kernel/mmalloc.o
[c06a32]325
[aa3877a]326TSingular: fegetopt.o mod2.h feOpt.cc version.h emacs.cc \
[59d417]327           feOptTS.inc
[c232af]328        ${CXX} -O2 ${CPPFLAGS} ${DEFS} -DTSINGULAR -o TSingular emacs.cc fegetopt.o \
[59d417]329        ${LDFLAGS} -lomalloc_ndebug ../kernel/mmalloc.o
[4b72f6]330
[7e5a38]331feOpt.o: feOpt.inc feOptES.inc feOptTS.inc
[f9e5f6]332extra.o: feOpt.inc
[c06a32]333
[7e5a38]334feOpt.inc: feOpt.cc mod2.h feOpt.h
[c232af]335        $(CXX) -DGENERATE_OPTION_INDEX feOpt.cc -o feOpt
[3dda3c]336        ./feOpt
337        /bin/rm -f feOpt feOpt.exe
[c06a32]338
[7e5a38]339feOptES.inc: feOpt.cc mod2.h feOpt.h
[c232af]340        $(CXX) -DGENERATE_OPTION_INDEX  -DESINGULAR feOpt.cc -o feOpt
[735236]341        ./feOpt
342        rm -f feOpt feOpt.exe
[e08f69]343
[7e5a38]344feOptTS.inc: feOpt.cc mod2.h feOpt.h
[c232af]345        $(CXX) -DGENERATE_OPTION_INDEX  -DTSINGULAR feOpt.cc -o feOpt
[ef0124]346        ./feOpt
347        rm -f feOpt feOpt.exe
348
[6b32990]349mpsr.so: $(MPSR_SOURCES:.cc=.dl_o)
[50cbdc]350        $(LD) ${SLDFLAGS} -o $@ $^ -L${libdir} ${MP_LIBS}
[6b32990]351
352dbmsr.so: $(DBMSR_SOURCES:.cc=.dl_o)
[50cbdc]353        $(LD) ${SLDFLAGS} -o $@ $^
[6b32990]354
[d14712]355src: scanner.cc grammar.h grammar.cc libparse.cc
[7a5e7c]356
[9c35ef]357mod2.h: stamp-h
[fe40293]358
[d439f7]359stamp-h : config.status mod2.h.in
[9c35ef]360        CONFIG_FILES= CONFIG_HEADERS="mod2.h" ./config.status
[f92fa13]361
[d439f7]362Makefile: Makefile.in config.status
[a492d2]363        CONFIG_FILES="Makefile" CONFIG_HEADERS= ./config.status
364
365config.status: configure
366        ./config.status --recheck
[f7b5a1]367
[5f9072]368configure: configure.in
[6a0839]369        @echo "WARNING: You need to rerun autoconf. I am proceeding, for now."
[5615cd9]370        @touch configure
[d439f7]371#       autoconf
[5f9072]372
[8654b5]373ifeq ($(SINGUNAME),ix86-Win)
[ef0124]374##
375## windows only targets
376##
[8654b5]377
378## resources
379Singular.rc: Singular.rc.in config.status
380        CONFIG_FILES="Singular.rc" CONFIG_HEADERS= ./config.status
381
382ESingular_res.o: Singular.rc
383        windres -DESINGULAR -i Singular.rc -o ESingular_res.o
384
385TSingular_res.o: Singular.rc
386        windres -DTSINGULAR -i Singular.rc -o TSingular_res.o
387
388Singular_res.o: Singular.rc
389        windres -DSINGULAR -i Singular.rc -o Singular_res.o
390
391## run
[ef0124]392run.o: run.c run.h
393        gcc -c -I. -O2 run.c -o run.o
394
[8654b5]395runTSingular : run.o TSingular_res.o
396        gcc -mwindows -e _mainCRTStartup run.o TSingular_res.o -o runTSingular.exe
[ef0124]397
[8654b5]398runESingular : run.o ESingular_res.o
399        gcc -mwindows -e _mainCRTStartup run.o ESingular_res.o -o runESingular.exe
[ef0124]400
[8654b5]401RUN_SINGULARS=runESingular runTSingular
[ef0124]402
[8654b5]403endif
[ef0124]404
[f7b5a1]405##
406## install targets
407##
[460c1e1]408install: all installbin installslib
[5f9072]409
[91f288]410installbin: ${SING_EXEC} libparse ESingular TSingular ${RUN_SINGULARS}
[5f9072]411        ${MKINSTALLDIRS} ${bindir}
[91f288]412        ${INSTALL_PROGRAM} ${SING_EXEC} ${SINGULAR}
[3b2531]413        -${INSTALL_PROGRAM} *.so ${bindir}
[ef0124]414        ${INSTALL_PROGRAM} libparse ${RUN_SINGULARS} ${bindir}
[50cbdc]415        ${INSTALL_PROGRAM} ESingular TSingular ${DL_LIBS} ${bindir}
[a70441f]416        chmod a+x ${SINGULAR}
[91f288]417        rm -f ${bindir}/${SING_EXEC}${EXEC_EXT}
[d7d9b0]418        cd ${bindir}; ${LN_S} ${SINGULAR} Singular${EXEC_EXT};
[5f9072]419
[460c1e1]420installslib: LIB
[1464878]421        test -r ${slibdir} || ${LN_S} `pwd`/LIB ${slibdir}
[5f9072]422
423
[d439f7]424uninstall: uninstallbin
[f7b5a1]425
426uninstallbin:
[a70441f]427        rm -f ${bindir}/Singular${EXEC_EXT}
428        rm -f ${SINGULAR}
[5f9072]429        -rmdir ${bindir}
430
[f7b5a1]431##
432## clean targest
433##
[b7b08c]434mostlyclean:
[2f5b71]435        -rm -f Singular Singular-static Singulara Singularg Singularp Singularb libparse feOpt*.inc
436        -rm -f *.o *.og core *.op *.ob *.ot Singulart *.od *_d.cc *_d.c  *.so*
[7e5a38]437        -rm -f ESingular* TSingular*
[5f9072]438
[b7b08c]439clean: mostlyclean
[f2d56b]440        -rm -f *.bak *.d *.dd depend
441        -rm -f ${slibdir}
[5f9072]442
443distclean: clean
[b7b08c]444        -rm -f iparith.inc mpsr_Tok.inc stamp.h
[96368b]445        -rm -f Singular* *.gprof *.bprof *~ .\#* version.h
[bb9d6d]446        -rm -f mod2.h Makefile TAGS* tags config.status config.cache config.log
[5f9072]447
[7a5e7c]448srcclean:
449        @echo "This command is intended for maintainers to use;"
450        @echo "Rebuilding the deleted files requires flex"
451        @echo "bison, perl"
[d14712]452        -rm -f scanner.cc grammar.h grammar.cc libparse.cc
[7a5e7c]453
454maintainer-clean: distclean srcclean
[5f9072]455        @echo "This command is intended for maintainers to use;"
[8fc5558]456        @echo "Rebuilding the deleted files requires flex"
[f003a9]457        @echo "bison, perl and autoconf"
[d439f7]458        -rm configure
[f7b5a1]459
460##
461## miscellanous targets
462##
[5f9072]463
[91f288]464install-bindist: $(HEADERS) $(SOURCES) Makefile depend
[c06a32]465        echo "#define MAKE_DISTRIBUTION " > distrib.h
[f4d659]466        sleep 1
[91f288]467        ${MAKE} ${SING_EXEC} ESingular TSingular libparse ${RUN_SINGULARS}
[0658d9]468        ${MKINSTALLDIRS} ${install_bindir}
[c2709f]469        ${INSTALL_PROGRAM} -s  ${SING_EXEC} ${install_bindir}/Singular
[d93dc3]470        -${INSTALL_PROGRAM} *.so ${install_bindir}
[50cbdc]471        ${INSTALL_PROGRAM} -s  libparse ${RUN_SINGULARS} ESingular TSingular ${DL_LIBS} ${install_bindir}
[c06a32]472        echo "#undef MAKE_DISTRIBUTION " > distrib.h
[2afef4]473
[60467b]474install-bindist-plural: install-bindist
475
476install-sharedist-plural: install-sharedist
477
[4b72f6]478install-sharedist: ${SLIBS_FILES} LIB/gftables
479        ${MKINSTALLDIRS} ${install_slibdir}
480        cp ${SLIBS_FILES} ${install_slibdir}
481        ${MKINSTALLDIRS} ${install_slibdir}/gftables
482        cp ${GFTABLES} ${install_slibdir}/gftables
483        chmod -R +rX ${install_slibdir}/*
484
[24189c]485tar:
[bf708a7]486        tar cf Singular-${SINGULAR_VERSION}-src.tar ${DISTFILES}
487        gzip -f Singular-${SINGULAR_VERSION}-src.tar
[24189c]488
[c232af]489backup: tar
490        mcopy -o Singular-${SINGULAR_VERSION}-src.tar.gz a:
[24189c]491
[2f436b]492TAGS:   ${SOURCES} ${ESOURCES} ${HEADERS}
493        etags ${SOURCES} ${ESOURCES} ${HEADERS}
[5f9072]494
[d439f7]495tags:   
[41c6ce]496        ctags *.y *.[lch] *.cc *.inc ../kernel/*.[ch] ../kernel/*.cc ../kernel/*.inc
[bb9d6d]497
[58c9f6]498echoLIBS:
499        @echo ${SLIBS}
500
[5f9072]501##
502## Below here is stuff for developpers
503#################################################################
504
[7e5a38]505
506##
507## .og files for having -O and -g object versions available at the same time
508##
509
510OBJG1 := $(CXXSOURCES:.cc=.og)
511OBJG2 := $(CSOURCES:.c=.og)
512
513OBJP1 := $(CXXSOURCES:.cc=.op)
514OBJP2 := $(CSOURCES:.c=.op)
515
516OBJB1 := $(CXXSOURCES:.cc=.ob)
517OBJB2 := $(CSOURCES:.c=.ob)
518
519OBJT1 := $(CXXSOURCES:.cc=.ot)
520OBJT2 := $(CSOURCES:.c=.ot)
521
522OBJA1 := $(CXXSOURCES:.cc=.oa)
523OBJA2 := $(CSOURCES:.c=.oa)
524
525
526OBJG=$(OBJG1) $(OBJG2)
527OBJP=$(OBJP1) $(OBJP2)
528OBJB=$(OBJB1) $(OBJB2)
529OBJT=$(OBJT1) $(OBJT2)
530OBJA=$(OBJA1) $(OBJA2)
531
[6b32990]532DL_TAILG=\"sog\"
533DL_TAILP=\"sop\"
534DL_TAILB=\"sob\"
535DL_TAILT=\"sot\"
536DL_TAILA=\"soa\"
537
538
[7e5a38]539ifeq ($(DL_KERNEL),1)
540
541OBJG := $(OBJG) $(DL_KERNEL_SOURCES:.cc=.og)
[2f5b71]542DL_LIBSG := $(MPSR_SO:%.so=%.sog) $(DBMSR_SO:%.so=%.sog)
[7e5a38]543
544OBJP := $(OBJP) $(DL_KERNEL_SOURCES:.cc=.op)
[2f5b71]545DL_LIBSP := $(MPSR_SO:%.so=%.sop) $(DBMSR_SO:%.so=%.sop)
[7e5a38]546
547OBJB := $(OBJB) $(DL_KERNEL_SOURCES:.cc=.ob)
[2f5b71]548DL_LIBSB := $(MPSR_SO:%.so=%.sob) $(DBMSR_SO:%.so=%.sob)
[7e5a38]549
550OBJT := $(OBJT) $(DL_KERNEL_SOURCES:.cc=.ot)
[2f5b71]551DL_LIBST := $(MPSR_SO:%.so=%.sot) $(DBMSR_SO:%.so=%.sot)
[7e5a38]552
553OBJA := $(OBJA) $(DL_KERNEL_SOURCES:.cc=.oa)
[2f5b71]554DL_LIBSA := $(MPSR_SO:%.so=%.soa) $(DBMSR_SO:%.so=%.soa)
[7e5a38]555
556else
557
[6b32990]558OBJG := $(OBJG) $(STATIC_SOURCES:.cc=.og) $(COMMON_SOURCES:.cc=.og)
[7e5a38]559DL_LIBSG=
560
[6b32990]561OBJP := $(OBJP) $(STATIC_SOURCES:.cc=.op) $(COMMON_SOURCES:.cc=.op)
[7e5a38]562DL_LIBSP=
563
[6b32990]564OBJB := $(OBJB) $(STATIC_SOURCES:.cc=.ob) $(COMMON_SOURCES:.cc=.ob)
[7e5a38]565DL_LIBSB=
566
[6b32990]567OBJT := $(OBJT) $(STATIC_SOURCES:.cc=.ot) $(COMMON_SOURCES:.cc=.ot)
[7e5a38]568DL_LIBST=
569
[6b32990]570OBJA := $(OBJA) $(STATIC_SOURCES:.cc=.oa) $(COMMON_SOURCES:.cc=.oa)
[7e5a38]571DL_LIBST=
572
573endif
574
575
[5f9072]576##
[f7b5a1]577## compiler and linker options for debug version
[5f9072]578##
579
580CCG             = gcc
[8b0b91]581CXXG            = @CXX@
[9d06971]582CXXM            = gcc -MM -MG -DGENERATE_DEPEND
583CCM             = gcc -MM -MG -DGENERATE_DEPEND
[5f9072]584
[d439f7]585CFLAGSG         = -g -Wall -Wno-unused ${PIPE}
586CXXFLAGSG       = -g -Wall -Wno-unused ${PIPE}
[5f9072]587CXXTEMPLFLAGSG  = -fno-implicit-templates
[7e5a38]588DEFSG           = -D@SING_UNAME@ @DEFS@ -DDL_TAIL=$(DL_TAILG)
[5f9072]589
590##
[7e5a38]591## Debug Targets
[d439f7]592##
593
[7e5a38]594%.dl_og: %.cc
595        ${CXXG} ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} ${SFLAGS} -c $< -o $@
[5f9072]596
[6b32990]597mpsr.sog: $(MPSR_SOURCES:.cc=.dl_og)
598        ${CXXG} ${CXXFLAGSG} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS}
599
600dbmsr.sog: $(DBMSR_SOURCES:.cc=.dl_og)
601        ${CXXG} ${CXXFLAGSG} ${SFLAGS} ${SLDFLAGS} ${LDFLAGS} -o $@ $^ ${MP_LIBS}
602
[5f9072]603claptmpl.og: claptmpl.cc mod2.h
604        $(CXXG)  ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
[c06a32]605
[7e5a38]606%.og: %.cc
[5f9072]607        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
608
[c232af]609$(OBJG2) : %.og: %.c
[5f9072]610        $(CCG)  ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
611
[59d417]612Singularg${S_EXT}: scanner.cc  $(OBJG)  $(DL_LIBSG)\
[b7b08c]613           iparith.og mpsr_Tok.og claptmpl.og tesths.cc version.h
[6b32990]614        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -o Singularg${S_EXT} \
[59d417]615        tesths.cc iparith.og mpsr_Tok.og claptmpl.og $(OBJG) ${LDFLAGSG} ${LIBS} -lomalloc ../kernel/mmalloc.og \
[c232af]616        ${LD_DYN_FLAGS} ${LD_LIBC}
[5f9072]617
[4e595a7]618iparith.og: iparith.inc iparith.cc
[a9004e]619        $(CXXG)  ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c iparith.cc -o iparith.og
[5f9072]620
621mpsr_Tok.og: iparith.inc mpsr_Tok.cc
[a9004e]622        $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${CXXTEMPLFLAGSG} ${DEFSG} -c mpsr_Tok.cc -o mpsr_Tok.og
[5f9072]623
624installg: Singularg
625        ${MKINSTALLDIRS} ${bindir}
626        ${INSTALL_PROGRAM} Singularg ${bindir} 
627
[aa3877a]628ESingularg: fegetopt.og mod2.h feOpt.cc version.h emacs.cc \
[59d417]629           feOptES.inc
630        ${CXXG} ${CXXFLAGSG} ${CPPFLAGS} -DESINGULAR -g ${DEFSG} -o ESingularg emacs.cc fegetopt.og ${LDFLAGS} ${LIBS} -lomalloc ../kernel/mmalloc.og
[8d38069]631
[51c163]632##
633## compiler and linker options for profile version
634##
635
636CCP             = gcc
[01ea78]637CXXP            = @CXX@
[51c163]638
[d439f7]639CFLAGSP         = -pg -O3 ${PIPE}
640CXXFLAGSP       = -pg -O3 ${PIPE}
[51c163]641CXXTEMPLFLAGSP  = -fno-implicit-templates
[d7d9b0]642DEFSP           = -DNDEBUG -DOM_NDEBUG -DDO_PROFILE -D@SING_UNAME@ @DEFS@ -DDL_TAIL=$(DL_TAILP)
[e78cce]643LDFLAGSP        = -static @LDFLAGS@
[51c163]644
[d439f7]645CFLAGSB         = -g -O3 ${PIPE}
646CXXFLAGSB       = -g -O3 ${PIPE}
[7f1b91]647CXXTEMPLFLAGSB  = -fno-implicit-templates
[d7d9b0]648DEFSB           = -D@SING_UNAME@ -DOM_NDEBUG -DNDEBUG @DEFS@ -DDL_TAIL=$(DL_TAILB)
[7f1b91]649LDFLAGSB        = -static @LDFLAGS@
[fc7421]650
[7f1b91]651# bprof object  file to link with
652BPROFOBJ        = /usr/local/lib/bmon.o
653
[d7d9b0]654DEFST           = -DNO_INLINE -DNDEBUG -D@SING_UNAME@ -DOM_TRACK=2 -DOM_CHECK=0 @DEFS@ -DDL_TAIL=$(DL_TAILT)
[70433b5]655LDFLAGST        = @LDFLAGS@
[c232af]656CFLAGST         = -g  -O2 -w ${PIPE}
657CXXFLAGST       = -g  -O2 -w ${PIPE}
[7f1b91]658
[51c163]659##
[9d72fe]660## op and ob files for gprof and bprof, ot for mtrack, oc for OMCHECK=1
[d439f7]661##
[51c163]662
[d439f7]663
[5f9072]664##
[b7b08c]665## check_aso
666##
667check_aso:
[a70441f]668        ${PERL} check_aso.pl $(SOURCES)
[b7b08c]669##
[5f9072]670## dependencies
671##
[b7b08c]672
[c1489f2]673%.dd: %.cc mod2.h
[7e5a38]674        echo $(@:.dd=.og) $(@:.dd=.op) $(@:.dd=_d.cc) $(@:.dd=.od) $(@:.dd=.ob) $(@:.dd=.ot) $(@:.dd=.oa) $(@:.dd=.dl_o) $(@:.dd=.dl_og) $(@:.dd=.dl_op) $(@:.dd=.dl_od) $(@:.dd=.dl_ob) $(@:.dd=.dl_ot) $(@:.dd=.dl_oa)" " \\ > $@
[5f9072]675        $(CXXM) -DGENTABLE ${CPPFLAGS} ${DEFSG} $< >> $@
676
[c1489f2]677%.d: %.c mod2.h
[6b32990]678        echo $(@:.d=.og) $(@:.d=.od) $(@:.dd=_d.c) $(@:.d=.op) $(@:.d=.ob) $(@:.d=.ot) $(@:.d=.oa)" " \\ > $@
[5f9072]679        $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@
680
[177884]681depend:   $(CXXSOURCES:.cc=.dd) $(ESOURCES:.cc=.dd) $(CSOURCES:.c=.d) mod2.h claptmpl.dd
[41c6ce]682        -cat *.dd >>depend
[5f9072]683
684ifeq (depend,$(wildcard depend))
685include depend
686endif
687
688
Note: See TracBrowser for help on using the repository browser.