1 | ################################################################# |
---|
2 | ### |
---|
3 | ### Makefile for Singular |
---|
4 | ### |
---|
5 | ################################################################# |
---|
6 | |
---|
7 | SHELL = /bin/sh |
---|
8 | |
---|
9 | ## |
---|
10 | ## various paths |
---|
11 | ## |
---|
12 | srcdir = . |
---|
13 | prefix = @prefix@ |
---|
14 | exec_prefix = @exec_prefix@ |
---|
15 | libdir = @libdir@ |
---|
16 | # includes are taken from here |
---|
17 | includedir = @includedir@ |
---|
18 | |
---|
19 | ## |
---|
20 | ## various programs |
---|
21 | ## |
---|
22 | |
---|
23 | CXX = g++ |
---|
24 | INSTALL_PROGRAM = @INSTALL@ |
---|
25 | INSTALL_DATA = @INSTALL@ -m 644 |
---|
26 | MKINSTALLDIRS = ../mkinstalldirs |
---|
27 | LN_S = ln -s |
---|
28 | |
---|
29 | ## |
---|
30 | ## compiler and linker options |
---|
31 | ## |
---|
32 | PIPE = -pipe |
---|
33 | CFLAGS = -O3 -w -fomit-frame-pointer ${PIPE} |
---|
34 | CXXFLAGS = -O3 -w -fomit-frame-pointer --no-rtti ${PIPE} -g |
---|
35 | CXXTEMPLFLAGS = -fno-implicit-templates --no-exceptions |
---|
36 | CPPFLAGS = -I${srcdir} -I${includedir} -I${srcdir}/../misc/ -I${srcdir}/../resource/ -I${srcdir}/../reporter/ -L${srcdir}/../reporter/ -L${libdir} -lgmp |
---|
37 | DEFS = -DNDEBUG -DOM_NDEBUG @DEFS@ |
---|
38 | |
---|
39 | #-DHAVE_RINGS |
---|
40 | # -DHAVE_RINGS # Doesn't work :( |
---|
41 | # -DNDEBUG -DOM_NDEBUG |
---|
42 | |
---|
43 | ## End configuration dependend stuff |
---|
44 | ################################################################# |
---|
45 | |
---|
46 | ### |
---|
47 | ### file sets |
---|
48 | ### |
---|
49 | |
---|
50 | # normal C++ source files |
---|
51 | CXXSOURCES= gnumpc.cc gnumpfl.cc longrat.cc longrat0.cc ffields.cc \ |
---|
52 | modulop.cc mpr_complex.cc \ |
---|
53 | numbers.cc rmodulo2m.cc rmodulon.cc shortfl.cc |
---|
54 | |
---|
55 | # normal C source files |
---|
56 | CSOURCES= |
---|
57 | |
---|
58 | SOURCES=${CSOURCES} ${CXXSOURCES} |
---|
59 | |
---|
60 | HEADERS= gnumpc.h gnumpfl.h longrat.h modulop.h ffields.h \ |
---|
61 | mpr_complex.h mpr_global.h numbers.h \ |
---|
62 | rmodulo2m.h rmodulon.h shortfl.h |
---|
63 | |
---|
64 | DISTFILES=${SOURCES} ${HEADERS} |
---|
65 | |
---|
66 | OBJS := $(CXXSOURCES:.cc=.o) $(CSOURCES:.c=.o) |
---|
67 | |
---|
68 | .cc.o: |
---|
69 | ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} -c $< |
---|
70 | .c.o: |
---|
71 | ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $< |
---|
72 | |
---|
73 | libcoeffs.a: ${OBJS} |
---|
74 | -rm -f libcoeffs.a |
---|
75 | ar cr $@ $^ |
---|
76 | |
---|
77 | ## ---------------------------------------------------------------------------- |
---|
78 | ## debug version: |
---|
79 | FLAGSG = -g ${PIPE} |
---|
80 | CXXFLAGSG = -g ${PIPE} |
---|
81 | DEFSG = @DEFS@ |
---|
82 | |
---|
83 | CCG = ${CC} |
---|
84 | CXXG = ${CXX} |
---|
85 | OBJSG1 := $(CXXSOURCES:.cc=.og) |
---|
86 | |
---|
87 | libcoeffs_g.a: ${OBJSG1} |
---|
88 | -rm -f libcoeffs_g.a |
---|
89 | ar cr $@ $^ |
---|
90 | |
---|
91 | %.og: %.cc |
---|
92 | $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFSG} -c $< -o $@ |
---|
93 | |
---|
94 | ## |
---|
95 | ## clean targest |
---|
96 | ## |
---|
97 | mostlyclean: |
---|
98 | -rm -f *.o *.og core *.op |
---|
99 | |
---|
100 | cleantest: |
---|
101 | -rm -Rf test test.dSYM/ |
---|
102 | |
---|
103 | clean: mostlyclean cleantest |
---|
104 | -rm -f *.bak *.d *.dd depend *.a *.so* |
---|
105 | |
---|
106 | tags: |
---|
107 | ctags *.c *.h *.cc *.inc |
---|
108 | |
---|
109 | all: libcoeffs.a libcoeffs_g.a |
---|
110 | |
---|
111 | install: all |
---|
112 | ${MKINSTALLDIRS} ${includedir} |
---|
113 | ${MKINSTALLDIRS} ${libdir} |
---|
114 | ${INSTALL_DATA} libcoeffs.a ${libdir}/libcoeffs.a |
---|
115 | ${INSTALL_DATA} libcoeffs_g.a ${libdir}/libcoeffs_g.a |
---|
116 | $(INSTALL_DATA) coeffs.h $(includedir)/coeffs.h |
---|
117 | |
---|
118 | test: test.cc libcoeffs.a |
---|
119 | ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} test.cc -L. -I. -lcoeffs -o test -lomalloc -lreporter |
---|