source: trunk/src/Makefile.in @ 748

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

fixed librappture.a to properly include object files from src2/core

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