1 | |
---|
2 | prefix = @prefix@ |
---|
3 | exec_prefix = @exec_prefix@ |
---|
4 | bindir = @bindir@ |
---|
5 | libdir = @libdir@ |
---|
6 | includedir = @includedir@ |
---|
7 | mandir = @mandir@ |
---|
8 | |
---|
9 | INSTALL = @INSTALL@ |
---|
10 | INSTALL_PROGRAM = ${INSTALL} -m 755 |
---|
11 | INSTALL_DATA = ${INSTALL} -m 644 |
---|
12 | INSTALL_SCRIPT = ${INSTALL} |
---|
13 | |
---|
14 | |
---|
15 | # tell make where to find the expat & libscew headers |
---|
16 | INCL_RP_DEPS = -I$(includedir) |
---|
17 | |
---|
18 | EXTERNAL_RP_LIBS = @LIB_SEARCH_DIRS@ -lexpat -lscew -lz -lb64 -lm |
---|
19 | |
---|
20 | |
---|
21 | # define the top of the rappture directory structure |
---|
22 | RP_BASE = @RP_BASE@ |
---|
23 | |
---|
24 | # define which programs can be made |
---|
25 | PROGS = librappture \ |
---|
26 | libRpObjects |
---|
27 | |
---|
28 | # define our compiling environment |
---|
29 | # |
---|
30 | CC = @CC@ |
---|
31 | CXX = @CXX@ |
---|
32 | DEBUG = -g -Wall |
---|
33 | DEBUG_PLUS = -g -DDEBUG |
---|
34 | LN = ln |
---|
35 | CFLAGS = -fPIC |
---|
36 | |
---|
37 | # define our directories |
---|
38 | # |
---|
39 | INCLUDES_DIR = $(RP_BASE)/include |
---|
40 | BIN_DIR = $(RP_BASE)/bin |
---|
41 | LIB_DIR = $(RP_BASE)/src |
---|
42 | SRC_DIR = $(RP_BASE)/src |
---|
43 | SRC2_DIR = $(RP_BASE)/src2 |
---|
44 | TEST_DIR = $(RP_BASE)/test |
---|
45 | |
---|
46 | CORE_SRC = $(SRC_DIR)/core |
---|
47 | CORE2_SRC = $(SRC2_DIR)/core |
---|
48 | FORT_SRC = $(SRC_DIR)/fortran |
---|
49 | CEE_SRC = $(SRC_DIR)/cee |
---|
50 | |
---|
51 | INCL_CORE = -I$(CORE_SRC) |
---|
52 | INCL_CORE2 = -I$(CORE2_SRC) |
---|
53 | INCL_CEE = -I$(CEE_SRC) |
---|
54 | INCL_FORTRAN = -I$(FORT_SRC) |
---|
55 | INCL_MATLAB = -I$(MATLAB_SRC) |
---|
56 | INCL_OCTAVE = -I$(OCTAVE_SRC) |
---|
57 | |
---|
58 | # default: |
---|
59 | |
---|
60 | all: ${PROGS} |
---|
61 | install: install_rappture \ |
---|
62 | install_rpobjs |
---|
63 | |
---|
64 | RP_IO_DEPS = RpLibrary.o RpLibraryCInterface.o RpLibraryFInterface.o \ |
---|
65 | scew_extras.o RpEntityRef.o RpUtils.o |
---|
66 | RP_UNITS_DEPS = RpUnitsStd.o RpUnits.o RpUnitsCInterface.o RpUnitsFInterface.o |
---|
67 | RP_UTILS_DEPS = RpUtils.o RpUtilsCInterface.o RpUtilsFInterface.o |
---|
68 | RP_OTHER_DEPS = RpFortranCommon.o RpBindingsDict.o \ |
---|
69 | RpBufferCInterface.o RpOutcomeCInterface.o |
---|
70 | RP_OBJS_DEP = RpVariable.o RpAbout.o RpNumber.o RpString.o RpBoolean.o \ |
---|
71 | RpChoice.o RpOption.o RpUnitsStd.o RpUnits.o |
---|
72 | #RpValue.o RpValueDouble.o RpValueString.o |
---|
73 | RP2_OBJ_DEP = $(CORE2_SRC)/Outcome.o $(CORE2_SRC)/Ptr.o $(CORE2_SRC)/RpBuffer.o $(CORE2_SRC)/RpEncode.o |
---|
74 | |
---|
75 | |
---|
76 | LDLIB_MACOSX = -dynamiclib -o $(LIB_DIR)/$@.dylib |
---|
77 | LDLIB_LINUX = -shared -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 |
---|
78 | |
---|
79 | # include rappture library definitions |
---|
80 | |
---|
81 | #### librappture shared object ########################################### |
---|
82 | |
---|
83 | librappture: $(RP_IO_DEPS) $(RP_UTILS_DEPS) $(RP_UNITS_DEPS) $(RP_OTHER_DEPS) |
---|
84 | (cd ../src2/core/; make Outcome.o Ptr.o RpBuffer.o RpEncode.o) |
---|
85 | $(INSTALL_DATA) $(CORE_SRC)/*.h $(INCLUDES_DIR) |
---|
86 | $(INSTALL_DATA) $(CEE_SRC)/*.h $(INCLUDES_DIR) |
---|
87 | $(INSTALL_DATA) $(FORT_SRC)/*.h $(INCLUDES_DIR) |
---|
88 | $(INSTALL_DATA) $(CORE2_SRC)/Outcome.h $(INCLUDES_DIR) |
---|
89 | $(INSTALL_DATA) $(CORE2_SRC)/Ptr.h $(INCLUDES_DIR) |
---|
90 | $(INSTALL_DATA) $(CORE2_SRC)/RpBuffer.h $(INCLUDES_DIR) |
---|
91 | $(INSTALL_DATA) $(CORE2_SRC)/RpEncode.h $(INCLUDES_DIR) |
---|
92 | $(INSTALL_DATA) $(CORE2_SRC)/rappture2.h $(INCLUDES_DIR) |
---|
93 | @if test "`uname`" == "Darwin"; then \ |
---|
94 | $(CXX) $(DEGUG) $(LDLIB_MACOSX) $^ $(RP2_OBJ_DEP) $(EXTERNAL_RP_LIBS); \ |
---|
95 | ar -r $@.a $^ $(RP2_OBJ_DEP); \ |
---|
96 | ranlib -s $@.a; \ |
---|
97 | else \ |
---|
98 | $(CXX) $(DEGUG) $(LDLIB_LINUX) $^ $(RP2_OBJ_DEP) $(EXTERNAL_RP_LIBS); \ |
---|
99 | /sbin/ldconfig -n $(LIB_DIR); \ |
---|
100 | ar -r $@.a $^ $(RP2_OBJ_DEP); \ |
---|
101 | ranlib $@.a; \ |
---|
102 | fi |
---|
103 | |
---|
104 | install_rappture: librappture |
---|
105 | @if test "`uname`" == "Darwin"; then \ |
---|
106 | cp $<.dylib $(libdir); \ |
---|
107 | cp $<.a $(libdir); \ |
---|
108 | else \ |
---|
109 | cp -d $<.so* $(libdir); \ |
---|
110 | cp -d $<.a $(libdir); \ |
---|
111 | fi |
---|
112 | $(INSTALL_DATA) $(INCLUDES_DIR)/* $(includedir) |
---|
113 | |
---|
114 | #### libRpObjects ######################################################## |
---|
115 | libRpObjects: $(RP_OBJS_DEP) |
---|
116 | @if test "`uname`" == "Darwin"; then \ |
---|
117 | $(CXX) $(DEGUG) $(LDLIB_MACOSX) $^ -lstdc++; \ |
---|
118 | else \ |
---|
119 | $(CXX) $(DEGUG) $(LDLIB_LINUX) $^ -lstdc++; \ |
---|
120 | /sbin/ldconfig -n $(LIB_DIR); \ |
---|
121 | fi |
---|
122 | |
---|
123 | install_rpobjs: libRpObjects |
---|
124 | @if test "`uname`" == "Darwin"; then \ |
---|
125 | cp $<.dylib $(libdir); \ |
---|
126 | else \ |
---|
127 | cp -d $<.so* $(libdir); \ |
---|
128 | fi |
---|
129 | |
---|
130 | #################################################################### |
---|
131 | |
---|
132 | # include core source files |
---|
133 | |
---|
134 | RpLibrary.o: $(CORE_SRC)/RpLibrary.cc |
---|
135 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_CORE2) $(INCL_RP_DEPS) |
---|
136 | |
---|
137 | scew_extras.o: $(CORE_SRC)/scew_extras.c |
---|
138 | $(CC) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_RP_DEPS) |
---|
139 | |
---|
140 | RpEntityRef.o: $(CORE_SRC)/RpEntityRef.cc |
---|
141 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_CORE2) |
---|
142 | |
---|
143 | RpUtils.o: $(CORE_SRC)/RpUtils.cc |
---|
144 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) |
---|
145 | |
---|
146 | RpUnitsStd.o: $(CORE_SRC)/RpUnitsStd.cc |
---|
147 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) |
---|
148 | |
---|
149 | RpUnits.o: $(CORE_SRC)/RpUnits.cc |
---|
150 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) |
---|
151 | |
---|
152 | RpBindingsDict.o: $(CORE_SRC)/RpBindingsDict.cc |
---|
153 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) |
---|
154 | |
---|
155 | |
---|
156 | # objects for rappture 2 developement |
---|
157 | |
---|
158 | RpVariable.o: $(CORE_SRC)/RpVariable.cc |
---|
159 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) |
---|
160 | |
---|
161 | RpAbout.o: $(CORE_SRC)/RpAbout.cc |
---|
162 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) |
---|
163 | |
---|
164 | RpNumber.o: $(CORE_SRC)/RpNumber.cc |
---|
165 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) |
---|
166 | |
---|
167 | RpString.o: $(CORE_SRC)/RpString.cc |
---|
168 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) |
---|
169 | |
---|
170 | RpBoolean.o: $(CORE_SRC)/RpBoolean.cc |
---|
171 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) |
---|
172 | |
---|
173 | RpChoice.o: $(CORE_SRC)/RpChoice.cc |
---|
174 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) |
---|
175 | |
---|
176 | RpOption.o: $(CORE_SRC)/RpOption.cc |
---|
177 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) |
---|
178 | |
---|
179 | RpValue.o: $(CORE_SRC)/RpValue.cc |
---|
180 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) |
---|
181 | |
---|
182 | RpValueDouble.o: $(CORE_SRC)/RpValueDouble.cc |
---|
183 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) |
---|
184 | |
---|
185 | RpValueString.o: $(CORE_SRC)/RpValueString.cc |
---|
186 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) |
---|
187 | |
---|
188 | |
---|
189 | # include cee binding definitions |
---|
190 | |
---|
191 | RpUtilsCInterface.o: $(CEE_SRC)/RpUtilsCInterface.cc |
---|
192 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_CEE) |
---|
193 | |
---|
194 | RpUnitsCInterface.o: $(CEE_SRC)/RpUnitsCInterface.cc |
---|
195 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_CEE) |
---|
196 | |
---|
197 | RpLibraryCInterface.o: $(CEE_SRC)/RpLibraryCInterface.cc $(CEE_SRC)/RpLibraryCInterface.h $(CEE_SRC)/RpBufferCInterface.h |
---|
198 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $< $(INCL_CORE) $(INCL_CORE2) $(INCL_CEE) $(INCL_RP_DEPS) |
---|
199 | |
---|
200 | RpBufferCInterface.o: $(CEE_SRC)/RpBufferCInterface.cc $(CEE_SRC)/RpBufferCInterface.h $(CEE_SRC)/RpOutcomeCInterface.h |
---|
201 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $< $(INCL_CORE) $(INCL_CORE2) $(INCL_CEE) $(INCL_RP_DEPS) |
---|
202 | |
---|
203 | RpOutcomeCInterface.o: $(CEE_SRC)/RpOutcomeCInterface.cc |
---|
204 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $< $(INCL_CORE) $(INCL_CORE2) $(INCL_CEE) $(INCL_RP_DEPS) |
---|
205 | |
---|
206 | |
---|
207 | |
---|
208 | # include fortran binding definitions |
---|
209 | |
---|
210 | RpUtilsFInterface.o: $(FORT_SRC)/RpUtilsFInterface.cc |
---|
211 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_FORTRAN) |
---|
212 | |
---|
213 | RpUnitsFInterface.o: $(FORT_SRC)/RpUnitsFInterface.cc |
---|
214 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_FORTRAN) |
---|
215 | |
---|
216 | RpFortranCommon.o: $(FORT_SRC)/RpFortranCommon.cc |
---|
217 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $< $(INCL_FORTRAN) |
---|
218 | |
---|
219 | RpLibraryFInterface.o: $(FORT_SRC)/RpLibraryFInterface.cc |
---|
220 | $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_CORE2) $(INCL_FORTRAN) $(INCL_RP_DEPS) |
---|
221 | |
---|
222 | |
---|
223 | docs: |
---|
224 | if test ! -d docs; then \ |
---|
225 | mkdir docs; \ |
---|
226 | fi |
---|
227 | if test ! -d docs/doxygen; then \ |
---|
228 | mkdir docs/doxygen; \ |
---|
229 | fi |
---|
230 | doxygen |
---|
231 | |
---|
232 | #### CLEAN UP ############################################################ |
---|
233 | clean: |
---|
234 | - rm -f *.o librappture.* libRp*.so* |
---|
235 | - rm -rf build |
---|
236 | |
---|
237 | distclean: clean |
---|
238 | - rm Makefile |
---|