1 | # Makefile for Rappture2 |
---|
2 | # Copyright (C) 2004-2007 Derrick S. Kearney. |
---|
3 | # For conditions of distribution and use, see license.terms |
---|
4 | |
---|
5 | # To compile and test, type: |
---|
6 | # ./configure; make test |
---|
7 | # The call of configure is optional if you don't have special requirements |
---|
8 | # |
---|
9 | # To install librappture2.* and rappture2.h, type: |
---|
10 | # make install |
---|
11 | # To install in $HOME instead of /usr/local, use: |
---|
12 | # make install prefix=$HOME |
---|
13 | |
---|
14 | CXX = @CXX@ |
---|
15 | |
---|
16 | CFLAGS=-g -Wall -pg -fPIC |
---|
17 | #CFLAGS=-O |
---|
18 | #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 |
---|
19 | #CFLAGS=-g -DDEBUG |
---|
20 | #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ |
---|
21 | # -Wstrict-prototypes -Wmissing-prototypes |
---|
22 | |
---|
23 | LDFLAGS=librappture2.a |
---|
24 | LDSHARED=$(CXX) |
---|
25 | CPP=$(CC) -E |
---|
26 | |
---|
27 | LIBS=librappture2.a |
---|
28 | SHAREDLIB=librappture2.so |
---|
29 | SHAREDLIBV=librappture2.so.0.0 |
---|
30 | SHAREDLIBM=librappture2.so.1 |
---|
31 | |
---|
32 | AR=ar rcv |
---|
33 | RANLIB=ranlib |
---|
34 | TAR=tar |
---|
35 | SHELL=/bin/sh |
---|
36 | EXE= |
---|
37 | |
---|
38 | prefix = @prefix@ |
---|
39 | datadir = @datadir@ |
---|
40 | datarootdir = @datarootdir@ |
---|
41 | exec_prefix = ${prefix} |
---|
42 | libdir = ${exec_prefix}/lib |
---|
43 | includedir = ${prefix}/include |
---|
44 | mandir = ${prefix}/share/man |
---|
45 | man3dir = ${mandir}/man3 |
---|
46 | |
---|
47 | OBJS = RpMesh1D.o RpField1D.o RpMeshTri2D.o RpMeshRect3D.o \ |
---|
48 | RpFieldRect3D.o RpMeshPrism3D.o RpFieldPrism3D.o RpSerialBuffer.o \ |
---|
49 | RpSerializer.o RpSerializable.o RpSimpleBuffer.o RpBuffer.o \ |
---|
50 | RpEncode.o Ptr.o Outcome.o |
---|
51 | # Lookup.o |
---|
52 | |
---|
53 | OBJA = |
---|
54 | # to use the asm code: make OBJA=match.o |
---|
55 | |
---|
56 | TEST_OBJS = test.o RpBuffer_test.o |
---|
57 | |
---|
58 | all: test$(EXE) RpBuffer_test$(EXE) |
---|
59 | |
---|
60 | check: testall |
---|
61 | testall: all |
---|
62 | @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ |
---|
63 | if ./test; then \ |
---|
64 | echo ' *** test test OK ***'; \ |
---|
65 | else \ |
---|
66 | echo ' *** test test FAILED ***'; \ |
---|
67 | fi |
---|
68 | if ./RpBuffer_test; then \ |
---|
69 | echo ' *** RpBuffer_test test OK ***'; \ |
---|
70 | else \ |
---|
71 | echo ' *** RpBuffer_test test FAILED ***'; \ |
---|
72 | fi |
---|
73 | |
---|
74 | librappture2.a: $(OBJS) $(OBJA) |
---|
75 | $(AR) $@ $(OBJS) $(OBJA) |
---|
76 | -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 |
---|
77 | |
---|
78 | $(SHAREDLIBV): $(OBJS) |
---|
79 | $(LDSHARED) -shared -o $@ $(OBJS) @LIB_SEARCH_DIRS@ -lz -lb64 |
---|
80 | rm -f $(SHAREDLIB) $(SHAREDLIBM) |
---|
81 | ln -s $@ $(SHAREDLIB) |
---|
82 | ln -s $@ $(SHAREDLIBM) |
---|
83 | |
---|
84 | test(EXE): test.o Ptr.o Outcome.o Lookup.o |
---|
85 | $(CXX) $(CFLAGS) -o $@ test.o Ptr.o Outcome.o Lookup.o |
---|
86 | |
---|
87 | |
---|
88 | RpBuffer_test$(EXE): RpBuffer_test.o $(LIBS) |
---|
89 | $(CXX) $(CFLAGS) -o $@ RpBuffer_test.o $(LDFLAGS) @LIB_SEARCH_DIRS@ -lz -lb64 |
---|
90 | |
---|
91 | install: $(LIBS) $(SHAREDLIBV) |
---|
92 | -@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi |
---|
93 | -@if [ ! -d $(includedir)/rappture2 ]; then mkdir -p $(includedir)/rappture2; fi |
---|
94 | -@if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi |
---|
95 | -@if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi |
---|
96 | cp *.h $(includedir)/rappture2 |
---|
97 | chmod 644 $(includedir)/rappture2/*.h |
---|
98 | cp $(LIBS) $(libdir) |
---|
99 | cp $(SHAREDLIBV) $(libdir) |
---|
100 | cd $(libdir); chmod 755 $(LIBS) |
---|
101 | -@(cd $(libdir); $(RANLIB) librappture2.a || true) >/dev/null 2>&1 |
---|
102 | cd $(libdir); if test -f $(SHAREDLIBV); then \ |
---|
103 | rm -f $(SHAREDLIB) $(SHAREDLIBM); \ |
---|
104 | ln -s $(SHAREDLIBV) $(SHAREDLIB); \ |
---|
105 | ln -s $(SHAREDLIBV) $(SHAREDLIBM); \ |
---|
106 | (ldconfig || true) >/dev/null 2>&1; \ |
---|
107 | fi |
---|
108 | # cp rappture.3 $(man3dir) |
---|
109 | # chmod 644 $(man3dir)/rappture.3 |
---|
110 | # The ranlib in install is needed on NeXTSTEP which checks file times |
---|
111 | # ldconfig is for Linux |
---|
112 | |
---|
113 | uninstall: |
---|
114 | cd $(includedir)/rappture2; rm *.h; \ |
---|
115 | cd $(libdir); rm -f librappture2.a; \ |
---|
116 | if test -f $(SHAREDLIBV); then \ |
---|
117 | rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \ |
---|
118 | fi |
---|
119 | cd $(man3dir); rm -f rappture.3 |
---|
120 | |
---|
121 | mostlyclean: clean |
---|
122 | clean: |
---|
123 | rm -f *.o *~ viz buffer1.txt test$(EXE) RpBuffer_test$(EXE) librappture2.* |
---|
124 | |
---|
125 | maintainer-clean: distclean |
---|
126 | distclean: clean |
---|
127 | rm Makefile |
---|
128 | |
---|
129 | depend: |
---|
130 | makedepend -- $(CFLAGS) -- *.[ch] |
---|
131 | |
---|
132 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
---|
133 | |
---|
134 | viz: viz.o librappture2.a |
---|
135 | $(CXX) $(CFLAGS) -o viz $^ |
---|
136 | |
---|
137 | libviz.a: Outcome.o RpMesh1D.o RpField1D.o RpMeshTri2D.o RpMeshRect3D.o RpFieldRect3D.o RpMeshPrism3D.o RpFieldPrism3D.o RpSerialBuffer.o RpSerializer.o RpSerializable.o RpSimpleBuffer.o RpBuffer.o |
---|
138 | $(AR) $@ $^ |
---|
139 | |
---|
140 | viz.o: viz.cc |
---|
141 | $(CXX) $(CFLAGS) -c -o viz.o viz.cc |
---|
142 | |
---|
143 | test: test.o Ptr.o Outcome.o Lookup.o |
---|
144 | $(CXX) $(CFLAGS) -o test test.o Ptr.o Outcome.o Lookup.o |
---|
145 | |
---|
146 | docs: |
---|
147 | if test ! -d ../../docs/rappture2; then \ |
---|
148 | mkdir ../../docs; \ |
---|
149 | mkdir ../../docs/rappture2; \ |
---|
150 | fi |
---|
151 | doxygen |
---|
152 | |
---|
153 | test.o: test.cc Ptr.h |
---|
154 | $(CXX) $(CFLAGS) -c -o test.o test.cc |
---|
155 | |
---|
156 | Ptr.o: Ptr.h Ptr.cpp |
---|
157 | $(CXX) $(CFLAGS) -c -o Ptr.o Ptr.cpp |
---|
158 | |
---|
159 | Outcome.o: Outcome.cpp Ptr.h |
---|
160 | $(CXX) $(CFLAGS) -c -o Outcome.o Outcome.cpp |
---|
161 | |
---|
162 | Lookup.o: Lookup.cpp Ptr.h |
---|
163 | $(CXX) $(CFLAGS) -c -o Lookup.o Lookup.cpp |
---|
164 | |
---|
165 | RpMesh1D.o: RpMesh1D.cc RpMesh1D.h RpNode.h |
---|
166 | $(CXX) $(CFLAGS) -c -o RpMesh1D.o RpMesh1D.cc |
---|
167 | |
---|
168 | RpField1D.o: RpField1D.cc RpField1D.h RpMesh1D.h RpNode.h |
---|
169 | $(CXX) $(CFLAGS) -c -o RpField1D.o RpField1D.cc |
---|
170 | |
---|
171 | RpMeshTri2D.o: RpMeshTri2D.cc RpMeshTri2D.h RpNode.h |
---|
172 | $(CXX) $(CFLAGS) -c -o RpMeshTri2D.o RpMeshTri2D.cc |
---|
173 | |
---|
174 | RpFieldTri2D.o: RpFieldTri2D.cc RpFieldTri2D.h RpNode.h |
---|
175 | $(CXX) $(CFLAGS) -c -o RpFieldTri2D.o RpFieldTri2D.cc |
---|
176 | |
---|
177 | RpMeshRect3D.o: RpMeshRect3D.cc RpMeshRect3D.h RpNode.h |
---|
178 | $(CXX) $(CFLAGS) -c -o RpMeshRect3D.o RpMeshRect3D.cc |
---|
179 | |
---|
180 | RpFieldRect3D.o: RpFieldRect3D.cc RpFieldRect3D.h RpNode.h |
---|
181 | $(CXX) $(CFLAGS) -c -o RpFieldRect3D.o RpFieldRect3D.cc |
---|
182 | |
---|
183 | RpMeshPrism3D.o: RpMeshPrism3D.cc RpMeshPrism3D.h RpNode.h |
---|
184 | $(CXX) $(CFLAGS) -c -o RpMeshPrism3D.o RpMeshPrism3D.cc |
---|
185 | |
---|
186 | RpFieldPrism3D.o: RpFieldPrism3D.cc RpFieldPrism3D.h RpNode.h |
---|
187 | $(CXX) $(CFLAGS) -c -o RpFieldPrism3D.o RpFieldPrism3D.cc |
---|
188 | |
---|
189 | RpSerialBuffer.o: RpSerialBuffer.cc RpSerialBuffer.h |
---|
190 | $(CXX) $(CFLAGS) -c -o RpSerialBuffer.o RpSerialBuffer.cc |
---|
191 | |
---|
192 | RpSerializer.o: RpSerializer.cc RpSerializer.h |
---|
193 | $(CXX) $(CFLAGS) -c -o RpSerializer.o RpSerializer.cc |
---|
194 | |
---|
195 | RpSerializable.o: RpSerializable.cc RpSerializable.h |
---|
196 | $(CXX) $(CFLAGS) -c -o RpSerializable.o RpSerializable.cc |
---|
197 | |
---|
198 | RpEncode.o: RpEncode.cc RpEncode.h |
---|
199 | $(CXX) $(CFLAGS) -c -o RpEncode.o RpEncode.cc |
---|
200 | |
---|
201 | RpBuffer.o: RpBuffer.cc RpBuffer.h |
---|
202 | $(CXX) $(CFLAGS) -c -o $@ -I ${includedir} RpBuffer.cc |
---|
203 | |
---|
204 | RpBuffer_test.o: RpBuffer_test.cc |
---|
205 | $(CXX) $(CFLAGS) -c -o $@ -I ${includedir} RpBuffer_test.cc |
---|
206 | |
---|
207 | RpSimpleBuffer.o: RpSimpleBuffer.cc RpSimpleBuffer.h |
---|
208 | $(CXX) $(CFLAGS) -c -o $@ -I ${includedir} RpSimpleBuffer.cc |
---|