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