source: git/kernel/makefile @ 3a3063

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