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