source: git/coeffs/Makefile.in @ f85d3e

spielwiese
Last change on this file since f85d3e was f85d3e, checked in by Oleksandr Motsak <motsak@…>, 14 years ago
1. Better makefile (debug test-g/no debug: test) 2. Zn Z2m seems to interfere with GMP folating point global init.
  • Property mode set to 100644
File size: 3.0 KB
Line 
1#################################################################
2###
3### Makefile for Singular
4###
5#################################################################
6
7SHELL           = /bin/sh
8
9##
10## various paths
11##
12srcdir          = .
13prefix          = @prefix@
14exec_prefix     = @exec_prefix@
15libdir          = @libdir@
16# includes are taken from here
17includedir      = @includedir@
18
19##
20## various programs
21##
22
23CXX             = @CXX@
24INSTALL         = @INSTALL@
25INSTALL_PROGRAM = @INSTALL_PROGRAM@
26INSTALL_DATA    = @INSTALL_DATA@
27MKINSTALLDIRS   = ../mkinstalldirs
28LN_S            = ln -s
29
30##
31## compiler and linker options
32##
33PIPE            = -pipe
34CFLAGS          = @CFLAGS@ ${PIPE}
35CXXFLAGS        = @CXXFLAGS@ ${PIPE} -g
36CXXTEMPLFLAGS   = -fno-implicit-templates --no-exceptions
37CPPFLAGS        = -I${srcdir} -I${includedir} -I${prefix}/include
38LDFLAGS         = -L${libdir} -L${prefix}/lib -L${srcdir}
39DEFS            = -DNDEBUG -DOM_NDEBUG @DEFS@
40
41LIBS            =  @LIBPREFIX@ -lcoeffs -lreporter -lresource -lgmp -lomalloc_ndebug
42LIBSG           =  @LIBPREFIX@ -lcoeffs_g -lreporter -lresource -lgmp -lomalloc
43
44#-DHAVE_RINGS
45# -DHAVE_RINGS # Doesn't work :(
46# -DNDEBUG -DOM_NDEBUG
47
48## End configuration dependend stuff
49#################################################################
50
51###
52### file sets
53###
54
55# normal C++ source files
56CXXSOURCES= gnumpc.cc gnumpfl.cc longrat.cc longrat0.cc ffields.cc \
57            modulop.cc mpr_complex.cc \
58            numbers.cc rintegers.cc rmodulo2m.cc rmodulon.cc shortfl.cc
59
60# normal C source files
61CSOURCES=
62
63SOURCES=${CSOURCES} ${CXXSOURCES}
64
65HEADERS= gnumpc.h gnumpfl.h longrat.h modulop.h ffields.h \
66         mpr_complex.h mpr_global.h numbers.h \
67         rintegers.h rmodulo2m.h rmodulon.h shortfl.h
68
69DISTFILES=${SOURCES} ${HEADERS}
70
71OBJS := $(CXXSOURCES:.cc=.o) $(CSOURCES:.c=.o)
72
73
74all: libcoeffs.a libcoeffs_g.a
75
76
77.cc.o: 
78        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} -c $<
79.c.o:
80        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $<
81
82libcoeffs.a: ${OBJS}
83        -rm -f $@
84        ar cr $@ $^
85
86## ----------------------------------------------------------------------------
87## debug version:
88FLAGSG         = -g ${PIPE}
89CXXFLAGSG       = -g ${PIPE}
90DEFSG           = @DEFS@
91
92CCG             = ${CC}
93CXXG            = ${CXX} -Wextra -Wall -pedantic -fdiagnostics-show-option -Wno-long-long
94OBJSG1 := $(CXXSOURCES:.cc=.og)
95
96libcoeffs_g.a: ${OBJSG1}
97        -rm -f libcoeffs_g.a
98        ar cr $@ $^
99
100%.og: %.cc
101        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFSG} -c $< -o $@
102
103##
104## clean targest
105##
106mostlyclean:
107        -rm -f *.o *.og core *.op
108
109cleantest:
110        -rm -f test test-g
111        -rm -Rf test test.dSYM/
112
113clean: mostlyclean cleantest
114        -rm -f *.bak *.d *.dd depend *.a *.so*
115
116tags:   
117        ctags *.c *.h *.cc *.inc
118
119install: all
120        ${MKINSTALLDIRS} ${includedir}
121        ${MKINSTALLDIRS} ${libdir}
122        ${INSTALL_DATA} libcoeffs.a ${libdir}/libcoeffs.a
123        ${INSTALL_DATA} libcoeffs_g.a ${libdir}/libcoeffs_g.a
124        $(INSTALL_DATA) coeffs.h $(includedir)/coeffs.h
125
126test: test.cc libcoeffs.a
127        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} test.cc ${LDFLAGS} ${LIBS} -o test
128
129
130test-g: test.cc libcoeffs_g.a
131        ${CXXG} ${CXXFLAGSG} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFSG} test.cc ${LDFLAGS} ${LIBSG} -o test-g
Note: See TracBrowser for help on using the repository browser.