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

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

cleaned up all the compile time warnings in core rappture2 objects

File size: 5.6 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
130viz: viz.o librappture2.a
131        $(CXX) $(CFLAGS) -o viz $^
132
133libviz.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
134        $(AR) $@ $^
135
136viz.o: viz.cc
137        $(CXX) $(CFLAGS) -c -o viz.o viz.cc
138
139test: test.o Ptr.o Outcome.o Lookup.o
140        $(CXX) $(CFLAGS) -o test test.o Ptr.o Outcome.o Lookup.o
141
142docs:
143        if test ! -d ../../docs/rappture2; then \
144          mkdir ../../docs; \
145          mkdir ../../docs/rappture2; \
146        fi
147        doxygen
148
149test.o: test.cc Ptr.h
150        $(CXX) $(CFLAGS) -c -o test.o test.cc
151
152Ptr.o: Ptr.h Ptr.cpp
153        $(CXX) $(CFLAGS) -c -o Ptr.o Ptr.cpp
154
155Outcome.o: Outcome.cpp Ptr.h
156        $(CXX) $(CFLAGS) -c -o Outcome.o Outcome.cpp
157
158Lookup.o: Lookup.cpp Ptr.h
159        $(CXX) $(CFLAGS) -c -o Lookup.o Lookup.cpp
160
161RpMesh1D.o: RpMesh1D.cc RpMesh1D.h RpNode.h
162        $(CXX) $(CFLAGS) -c -o RpMesh1D.o RpMesh1D.cc
163
164RpField1D.o: RpField1D.cc RpField1D.h RpMesh1D.h RpNode.h
165        $(CXX) $(CFLAGS) -c -o RpField1D.o RpField1D.cc
166
167RpMeshTri2D.o: RpMeshTri2D.cc RpMeshTri2D.h RpNode.h
168        $(CXX) $(CFLAGS) -c -o RpMeshTri2D.o RpMeshTri2D.cc
169
170RpFieldTri2D.o: RpFieldTri2D.cc RpFieldTri2D.h RpNode.h
171        $(CXX) $(CFLAGS) -c -o RpFieldTri2D.o RpFieldTri2D.cc
172
173RpMeshRect3D.o: RpMeshRect3D.cc RpMeshRect3D.h RpNode.h
174        $(CXX) $(CFLAGS) -c -o RpMeshRect3D.o RpMeshRect3D.cc
175
176RpFieldRect3D.o: RpFieldRect3D.cc RpFieldRect3D.h RpNode.h
177        $(CXX) $(CFLAGS) -c -o RpFieldRect3D.o RpFieldRect3D.cc
178
179RpMeshPrism3D.o: RpMeshPrism3D.cc RpMeshPrism3D.h RpNode.h
180        $(CXX) $(CFLAGS) -c -o RpMeshPrism3D.o RpMeshPrism3D.cc
181
182RpFieldPrism3D.o: RpFieldPrism3D.cc RpFieldPrism3D.h RpNode.h
183        $(CXX) $(CFLAGS) -c -o RpFieldPrism3D.o RpFieldPrism3D.cc
184
185RpSerialBuffer.o: RpSerialBuffer.cc RpSerialBuffer.h
186        $(CXX) $(CFLAGS) -c -o RpSerialBuffer.o RpSerialBuffer.cc
187
188RpSerializer.o: RpSerializer.cc RpSerializer.h
189        $(CXX) $(CFLAGS) -c -o RpSerializer.o RpSerializer.cc
190
191RpSerializable.o: RpSerializable.cc RpSerializable.h
192        $(CXX) $(CFLAGS) -c -o RpSerializable.o RpSerializable.cc
193
194RpBuffer.o: RpBuffer.cc RpBuffer.h
195        $(CXX) $(CFLAGS) -c -o $@ -I ${includedir} RpBuffer.cc
196
197RpBuffer_test.o: RpBuffer_test.cc
198        $(CXX) $(CFLAGS) -c -o $@ -I ${includedir} RpBuffer_test.cc
199
Note: See TracBrowser for help on using the repository browser.