source: trunk/src2/core/Makefile.in @ 605

Last change on this file since 605 was 596, checked in by dkearney, 17 years ago

fixed librappture2 to be areal library instead of an executable
adjusted rappture pointers to return reference to ptr object.

File size: 5.7 KB
Line 
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
14CXX             = @CXX@
15
16CFLAGS=-g -Wall
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
23LDFLAGS=librappture2.a
24LDSHARED=$(CXX)
25CPP=$(CC) -E
26
27LIBS=librappture2.a
28SHAREDLIB=librappture2.so
29SHAREDLIBV=librappture2.so.0.0
30SHAREDLIBM=librappture2.so.1
31
32AR=ar rcv
33RANLIB=ranlib
34TAR=tar
35SHELL=/bin/sh
36EXE=
37
38prefix = @prefix@
39exec_prefix = ${prefix}
40libdir = ${exec_prefix}/lib
41includedir = ${prefix}/include
42mandir = ${prefix}/share/man
43man3dir = ${mandir}/man3
44
45OBJS = RpMesh1D.o RpField1D.o RpMeshTri2D.o RpMeshRect3D.o \
46       RpFieldRect3D.o RpMeshPrism3D.o RpFieldPrism3D.o RpSerialBuffer.o \
47       RpSerializer.o RpSerializable.o RpBuffer.o Ptr.o Outcome.o # Lookup.o
48
49OBJA =
50# to use the asm code: make OBJA=match.o
51
52TEST_OBJS = test.o RpBuffer_test.o
53
54all: test$(EXE) RpBuffer_test$(EXE)
55
56check: testall
57testall: all
58        @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
59        if ./test; then \
60          echo '                *** test test OK ***'; \
61        else \
62          echo '                *** test test FAILED ***'; \
63        fi
64        if ./RpBuffer_test; then \
65          echo '                *** RpBuffer_test test OK ***'; \
66        else \
67          echo '                *** RpBuffer_test test FAILED ***'; \
68        fi
69
70librappture2.a: $(OBJS) $(OBJA)
71        $(AR) $@ $(OBJS) $(OBJA)
72        -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
73
74$(SHAREDLIBV): $(OBJS)
75        $(LDSHARED) -shared -Wl,-rpath,${libdir} -o $@ $(OBJS) -L ${libdir} -lz -lb64
76        rm -f $(SHAREDLIB) $(SHAREDLIBM)
77        ln -s $@ $(SHAREDLIB)
78        ln -s $@ $(SHAREDLIBM)
79
80test(EXE): test.o Ptr.o Outcome.o Lookup.o
81        $(CXX) $(CFLAGS) -o $@ test.o Ptr.o Outcome.o Lookup.o
82
83
84RpBuffer_test$(EXE): RpBuffer_test.o $(LIBS)
85        $(CXX) $(CFLAGS) -o $@ RpBuffer_test.o $(LDFLAGS) -L ${libdir} -lz -lb64
86
87install: $(LIBS) $(SHAREDLIBV)
88        -@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi
89        -@if [ ! -d $(includedir)/rappture2  ]; then mkdir -p $(includedir)/rappture2; fi
90        -@if [ ! -d $(libdir)      ]; then mkdir -p $(libdir); fi
91        -@if [ ! -d $(man3dir)     ]; then mkdir -p $(man3dir); fi
92        cp *.h $(includedir)/rappture2
93        chmod 644 $(includedir)/rappture2/*.h
94        cp $(LIBS) $(libdir)
95        cp $(SHAREDLIBV) $(libdir)
96        cd $(libdir); chmod 755 $(LIBS)
97        -@(cd $(libdir); $(RANLIB) librappture2.a || true) >/dev/null 2>&1
98        cd $(libdir); if test -f $(SHAREDLIBV); then \
99          rm -f $(SHAREDLIB) $(SHAREDLIBM); \
100          ln -s $(SHAREDLIBV) $(SHAREDLIB); \
101          ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
102          (ldconfig || true)  >/dev/null 2>&1; \
103        fi
104#       cp rappture.3 $(man3dir)
105#       chmod 644 $(man3dir)/rappture.3
106# The ranlib in install is needed on NeXTSTEP which checks file times
107# ldconfig is for Linux
108
109uninstall:
110        cd $(includedir)/rappture2; rm *.h; \
111        cd $(libdir); rm -f librappture2.a; \
112        if test -f $(SHAREDLIBV); then \
113          rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
114        fi
115        cd $(man3dir); rm -f rappture.3
116
117mostlyclean: clean
118clean:
119        rm -f *.o *~ viz buffer1.txt test$(EXE) RpBuffer_test$(EXE) librappture2.*
120
121maintainer-clean: distclean
122distclean: clean
123        rm Makefile
124
125depend:
126        makedepend -- $(CFLAGS) -- *.[ch]
127
128# DO NOT DELETE THIS LINE -- make depend depends on it.
129
130# should use librappture2.a or $(LDFLAGS)  but this uses RpOutcome.o
131viz: viz.o libviz.a
132        $(CXX) $(CFLAGS) -o viz $^
133
134libviz.a: Outcome.o RpMesh1D.o RpField1D.o RpMeshTri2D.o RpMeshRect3D.o RpFieldRect3D.o RpMeshPrism3D.o RpFieldPrism3D.o RpSerialBuffer.o RpSerializer.o RpSerializable.o RpBuffer.o
135        $(AR) $@ $^
136
137viz.o: viz.cc
138        $(CXX) $(CFLAGS) -c -o viz.o viz.cc
139
140test: test.o Ptr.o Outcome.o Lookup.o
141        $(CXX) $(CFLAGS) -o test test.o Ptr.o Outcome.o Lookup.o
142
143docs:
144        if test ! -d ../../docs/rappture2; then \
145          mkdir ../../docs; \
146          mkdir ../../docs/rappture2; \
147        fi
148        doxygen
149
150test.o: test.cc Ptr.h
151        $(CXX) $(CFLAGS) -c -o test.o test.cc
152
153Ptr.o: Ptr.h Ptr.cpp
154        $(CXX) $(CFLAGS) -c -o Ptr.o Ptr.cpp
155
156Outcome.o: Outcome.cpp Ptr.h
157        $(CXX) $(CFLAGS) -c -o Outcome.o Outcome.cpp
158
159Lookup.o: Lookup.cpp Ptr.h
160        $(CXX) $(CFLAGS) -c -o Lookup.o Lookup.cpp
161
162RpMesh1D.o: RpMesh1D.cc RpMesh1D.h RpNode.h
163        $(CXX) $(CFLAGS) -c -o RpMesh1D.o RpMesh1D.cc
164
165RpField1D.o: RpField1D.cc RpField1D.h RpMesh1D.h RpNode.h
166        $(CXX) $(CFLAGS) -c -o RpField1D.o RpField1D.cc
167
168RpMeshTri2D.o: RpMeshTri2D.cc RpMeshTri2D.h RpNode.h
169        $(CXX) $(CFLAGS) -c -o RpMeshTri2D.o RpMeshTri2D.cc
170
171RpFieldTri2D.o: RpFieldTri2D.cc RpFieldTri2D.h RpNode.h
172        $(CXX) $(CFLAGS) -c -o RpFieldTri2D.o RpFieldTri2D.cc
173
174RpMeshRect3D.o: RpMeshRect3D.cc RpMeshRect3D.h RpNode.h
175        $(CXX) $(CFLAGS) -c -o RpMeshRect3D.o RpMeshRect3D.cc
176
177RpFieldRect3D.o: RpFieldRect3D.cc RpFieldRect3D.h RpNode.h
178        $(CXX) $(CFLAGS) -c -o RpFieldRect3D.o RpFieldRect3D.cc
179
180RpMeshPrism3D.o: RpMeshPrism3D.cc RpMeshPrism3D.h RpNode.h
181        $(CXX) $(CFLAGS) -c -o RpMeshPrism3D.o RpMeshPrism3D.cc
182
183RpFieldPrism3D.o: RpFieldPrism3D.cc RpFieldPrism3D.h RpNode.h
184        $(CXX) $(CFLAGS) -c -o RpFieldPrism3D.o RpFieldPrism3D.cc
185
186RpSerialBuffer.o: RpSerialBuffer.cc RpSerialBuffer.h
187        $(CXX) $(CFLAGS) -c -o RpSerialBuffer.o RpSerialBuffer.cc
188
189RpSerializer.o: RpSerializer.cc RpSerializer.h
190        $(CXX) $(CFLAGS) -c -o RpSerializer.o RpSerializer.cc
191
192RpSerializable.o: RpSerializable.cc RpSerializable.h
193        $(CXX) $(CFLAGS) -c -o RpSerializable.o RpSerializable.cc
194
195RpBuffer.o: RpBuffer.cc RpBuffer.h
196        $(CXX) $(CFLAGS) -c -o $@ -I ${includedir} RpBuffer.cc
197
198RpBuffer_test.o: RpBuffer_test.cc
199        $(CXX) $(CFLAGS) -c -o $@ -I ${includedir} RpBuffer_test.cc
200
Note: See TracBrowser for help on using the repository browser.