source: git/kernel/makefile @ b54a36e

spielwiese
Last change on this file since b54a36e was b54a36e, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
ADD: make should now also build libkernel*... ADD: 'make check' in kernel/ will try to link against libpolys AND libkernel_g.a
  • Property mode set to 100644
File size: 6.9 KB
RevLine 
[6c19d8]1# Generated automatically from Makefile.in by configure.-
2#################################################################
3###
4### Makefile for Singular
5###
6#################################################################
7
8SHELL           = /bin/sh
9
10##
11## version
12##
13SINGULAR_VERSION        = spielwiese
14##
15## various paths
16##
17srcdir          = .
18includedir      = ../libpolys
19
20##
21## various programs
22##
23
24CC              = gcc
25LD              = ld
26CXX             = g++
27PERL            = perl
28INSTALL         = /usr/bin/install -c
29INSTALL_PROGRAM = ${INSTALL}
30INSTALL_DATA    = ${INSTALL} -m 644
31MKINSTALLDIRS   = ./mkinstalldirs
32LN_S            = ln -s
33
34##
35## compiler and linker options
36##
[b54a36e]37LIBPOLYS_CFLAGS = -I.. -I../libpolys
38LIBPOLYS_LIBS   = -L../factory -L../omalloc -L../libpolys/misc -L../libpolys/reporter -L../libpolys/resources -L../libpolys/coeffs -L../libpolys/polys -lpolys_g -lcoeffs_g -lresources_g -lreporter_g -lmisc_g -lfactory -lomalloc_g
[cab375]39
[6c19d8]40PIPE            = -pipe
[cab375]41CFLAGS          = -O3 -w -fomit-frame-pointer ${PIPE} ${LIBPOLYS_CFLAGS}
42CXXFLAGS        = -O3 -w -fomit-frame-pointer --no-rtti ${PIPE} ${LIBPOLYS_CFLAGS}
[6c19d8]43CXXTEMPLFLAGS   = -fno-implicit-templates --no-exceptions
[cab375]44CPPFLAGS        = -I${srcdir} -I..  -I${includedir}   ${LIBPOLYS_CFLAGS}
[6c19d8]45DEFS            = -DNDEBUG -DOM_NDEBUG
46LDFLAGS         = -L${srcdir}/lib
47LD_DYN_FLAGS    = -ldl -rdynamic
48SFLAGS          = -fpic -DPIC
49SLDFLAGS        = -shared
50
51LD_LIBC         = -lc
52STATIC_LDFLAGS  = -static
53LIBS            = -lm -lsingfac -lsingcf -lntl -lgmp -lreadline -lncurses -lm  -lnsl  -lomalloc_ndebug
54MP_LIBS         = -lMPT -lMP -lnsl
55
56## End configuration dependend stuff
57#################################################################
58
59###
60### file sets
61###
62
63# normal C++ source files
64CXXSOURCES=\
65    febase.cc feread.cc \
66    hdegree.cc hilb.cc hutil.cc \
67    gr_kstd2.cc \
[1745e5]68    ideals.cc \
[6c19d8]69    khstd.cc kstdfac.cc \
70    kstd1.cc kstd2.cc kutil.cc \
[76cfef]71    misc.cc \
72    fast_maps.cc \
[6c19d8]73    fglmzero.cc fglmvec.cc fglmgauss.cc fglmhom.cc fglmcomb.cc \
74    kspoly.cc \
[f78059]75    semic.cc \
[6c19d8]76    syz.cc syz0.cc syz1.cc syz2.cc syz3.cc\
77    timer.cc \
78    GMPrat.cc multicnt.cc npolygon.cc semic.cc spectrum.cc splist.cc \
79    walkProc.cc walkMain.cc walkSupport.cc\
80    eigenval.cc units.cc \
81    fast_mult.cc digitech.cc \
82    tgb.cc tgbgauss.cc ringgb.cc f5data.cc f5lists.cc f5gb.cc \
[2b85f31]83    f5c.cc ratgring.cc shiftgb.cc gfan.cc \
[6c19d8]84    linearAlgebra.cc
85CXXSOURCES2     = SingularBuilder.cpp
86
[76cfef]87#    numbers.cc polys.cc p_polys.cc polys0.cc polys1.cc polys-impl.cc \
88
[6c19d8]89# normal C source files
90CSOURCES=fegetopt.c mmstd.c
91
92# special C++ source files (need extra compiling and/or linking), for which
93# dependencies should be generated
94ESOURCES=mmalloc.cc
95
96SOURCES=${CSOURCES} ${CXXSOURCES} \
[c6e80e]97        kInline.h
[6c19d8]98
99HEADERS=hutil.h idrec.h stairc.h ideals.h \
[1745e5]100        structs.h \
[6c19d8]101        syz.h \
102        fast_maps.h \
103        febase.h \
104        walkProc.h walkMain.h walkSupport.h\
105        khstd.h sparsmat.h \
106        fglm.h kstd1.h \
107        fglmgauss.h fglmvec.h \
108        kstdfac.h kmatrix.h\
109        kutil.h \
110        dbm_sl.h \
111        GMPrat.h multicnt.h npolygon.h semic.h spectrum.h splist.h multicnt.h \
112        eigenval.h units.h \
113        fegetopt.h \
114        ratgring.h shiftgb.h \
115        mmalloc.h \
[f78059]116        semic.h \
[6c19d8]117        gfan.h
118
119DISTFILES=${SOURCES} ${HEADERS} ${ESOURCES} \
120        Makefile.in \
121        mod2.h.in install-sh mkinstalldirs
122
123OBJS := $(CXXSOURCES:.cc=.o) $(CSOURCES:.c=.o) #$(CXXSOURCES2:.cpp=.o)
124OBJS2 := $(ESOURCES:.cc=.o)
125OBJSG2 := $(ESOURCES:.cc=.og)
126OBJSP2 := $(ESOURCES:.cc=.op)
127
128##
129## Build Targets
130##
131.cc.o: 
132        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} -c $<
133.c.o:
134        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $<
135
136OBJG= $(CXXSOURCES:.cc=.og) $(CSOURCES:.c=.og)
137
138OBJG := $(OBJG) $(STATIC_SOURCES:.cc=.og) 
139OBJP := $(OBJP) $(STATIC_SOURCES:.cc=.op) 
140
141all:    libkernel.a libkernel_g.a mmalloc.o ${OBJS2}
142
143libkernel.a: ${OBJS}
144        -rm -f libkernel.a
145        ar cr $@ $^
146
147##
148## install targets
149##
150install-nolns: install
151
152install-libsingular: install
153        -${MKINSTALLDIRS} ${includedir}
154        -${MKINSTALLDIRS} ${includedir}/singular
[c6e80e]155        -for file in *.h kInline.h; do sed -e "s:<kernel/:<singular/:"< $$file | sed -e "s:<Singular/:<singular/:"|sed -e "s:<omalloc/:<:"|sed -e "s:<factory/:<:" > ${includedir}/singular/$$file; done
[6c19d8]156
157install: all installbin
158
159install_all: install libkernel_p.a
160        - ranlib libkernel_p.a
161
162installbin: libkernel.a libkernel_g.a
163        ${MKINSTALLDIRS} ${bindir}
164        - ranlib libkernel.a
165        - ranlib libkernel_g.a
166
167install-bindist: libkernel.a
168        ${MKINSTALLDIRS} ${bindir}
169
170##
171## clean targest
172##
173mostlyclean: 
174        -rm -f *.o *.og core *.op
175
176clean: mostlyclean
177        -rm -f *.bak *.d *.dd depend *.a *.so*
178
179distclean: clean
180        -rm -f *~ .\#*
181        -rm -f mod2.h Makefile TAGS* tags config.status config.cache config.log
182
183srcclean:
184        @echo "This command is intended for maintainers to use;"
185        @echo "Rebuilding the deleted files requires flex"
186        @echo "bison, perl"
187
188maintainer-clean: distclean srcclean
189        @echo "This command is intended for maintainers to use;"
190        @echo "Rebuilding the deleted files requires flex"
191        @echo "bison, perl and autoconf"
192
193##
194## miscellanous targets
195##
196
197TAGS:   ${SOURCES} ${ESOURCES} ${HEADERS}
198        etags ${SOURCES} ${ESOURCES} ${HEADERS}
199
200tags:   
201        ctags *.c *.h *.cc *.inc
202
203##
204## Below here is stuff for developpers
205#################################################################
206
207
208##
209## .og files for having -O and -g object versions available at the same time
210##
211
212OBJG1 := $(CXXSOURCES:.cc=.og) 
213OBJG2 := $(CSOURCES:.c=.og) 
214
215##
216## compiler and linker options for debug version
217##
218
219CCG             = ${CC}
220CXXG            = ${CXX} -Wall
221CXXM            = gcc -MM -MG -DGENERATE_DEPEND
222CCM             = gcc -MM -MG -DGENERATE_DEPEND
223
[cab375]224CFLAGSG         = -g ${PIPE} ${LIBPOLYS_CFLAGS}
225CXXFLAGSG       = -g ${PIPE} ${LIBPOLYS_CFLAGS}
[6c19d8]226DEFSG           = 
227
228##
229## Debug Targets
230##
231
232%.og: %.cc
233        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFSG} -c $< -o $@
234
235$(OBJG2) : %.og: %.c
236        $(CCG)  ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
237
238libkernel_g.a: ${OBJG} ${OBJSG2}
239        -rm -f libkernel_g.a
240        ar cr $@ ${OBJG}
241
[210e07]242
243
[6c19d8]244##
245## .op files for profiling
246##
247
248OBJP1 := $(CXXSOURCES:.cc=.op) 
249OBJP2 := $(CSOURCES:.c=.op) 
250
251OBJP=$(OBJP1) $(OBJP2) 
252
253OBJP := $(OBJP) $(STATIC_SOURCES:.cc=.op) 
254
255##
256## compiler and linker options for profiling version
257##
258
259CCP             = ${CC}
260CXXP            = ${CXX}
261
[cab375]262CFLAGSP         = -g -pg -O ${PIPE} ${LIBPOLYS_CFLAGS}
263CXXFLAGSP       = -g -pg -O ${PIPE} ${LIBPOLYS_CFLAGS}
[6c19d8]264DEFSP           = 
265
[210e07]266
267
268
[6c19d8]269##
270## Profiling Targets
271##
272
273%.op: %.cc
274        $(CXXP) ${CXXFLAGSP} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFSP} -c $< -o $@
275
276$(OBJP2) : %.op: %.c
277        $(CCP)  ${CFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@
278
279libkernel_p.a: ${OBJP} ${OBJSP2}
280        -rm -f libkernel_p.a
281        ar cr $@ ${OBJP}
282
283##
284## dependencies
285##
286
287%.dd: %.cc mod2.h
288        echo $(@:.dd=.og) $(@:.dd=.op) " " \\ > $@
289        $(CXXM) -DGENTABLE ${CPPFLAGS} ${DEFSG} $< >> $@
290
291%.d: %.c mod2.h
292        echo $(@:.d=.og) $(@:.d=.op) " " \\ > $@
293        $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@
294
295depend:   $(CXXSOURCES:.cc=.dd) $(ESOURCES:.cc=.dd) $(CSOURCES:.c=.d) mod2.h
296        cat *.d *.dd >depend
297
298ifeq (depend,$(wildcard depend))
299include depend
300endif
301
302
[b54a36e]303test.o: test.cc mod2.h libkernel_g.a 
304        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFSG} -c $< -o $@ 
[210e07]305
[b54a36e]306
307# My headers test
308check: test.o
309        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFSG} $< -o test -L. -lkernel_g ${LIBPOLYS_LIBS} -lntl -ldl -lgmp
Note: See TracBrowser for help on using the repository browser.