source: trunk/src/Makefile.in @ 708

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

updateing build system for rappture and language bindings.
librappture now includes a static version of libscew.
this means librappture needs to be linked directly against libexpat.
removed references to libscew from language bindings' makefiles.
corrected matlab and octave makefiles to only compile when dependencies are updated.
added --libdir flag so you can install platform dependent files into lib64 on 64-bit systems.
adjusted the rappture.env file to add lib64 directories to search paths incase they exist.

File size: 7.6 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)/src
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        @if test "`uname`" == "Darwin"; then \
100                $(CXX) $(DEGUG) $(LDLIB_MACOSX) $^ $(RP2_OBJ_DEP) $(EXTERNAL_RP_LIBS); \
101                ar -r $@.a $^; \
102                ranlib -s $@.a; \
103        else \
104                $(CXX) $(DEGUG) $(LDLIB_LINUX) $^ $(RP2_OBJ_DEP) $(EXTERNAL_RP_LIBS); \
105                /sbin/ldconfig -n $(LIB_DIR); \
106                ar -r $@.a $^; \
107                ranlib $@.a; \
108        fi
109
110install_rappture: librappture
111        @if test "`uname`" == "Darwin"; then \
112                cp $<.dylib $(libdir); \
113                cp $<.a $(libdir); \
114        else \
115                cp -d $<.so* $(libdir); \
116                cp -d $<.a $(libdir); \
117        fi
118        $(INSTALL_DATA) $(CORE_SRC)/*.h $(includedir)
119        $(INSTALL_DATA) $(CEE_SRC)/*.h $(includedir)
120        $(INSTALL_DATA) $(FORT_SRC)/*.h $(includedir)
121        $(INSTALL_DATA) $(CORE2_SRC)/Outcome.h $(includedir)
122        $(INSTALL_DATA) $(CORE2_SRC)/Ptr.h $(includedir)
123        $(INSTALL_DATA) $(CORE2_SRC)/RpBuffer.h $(includedir)
124        $(INSTALL_DATA) $(CORE2_SRC)/rappture2.h $(includedir)
125
126#### libRpObjects ########################################################
127libRpObjects: $(RP_OBJS_DEP)
128        @if test "`uname`" == "Darwin"; then \
129                $(CXX) $(DEGUG) $(LDLIB_MACOSX) $^ -lstdc++; \
130        else \
131                $(CXX) $(DEGUG) $(LDLIB_LINUX) $^ -lstdc++; \
132                /sbin/ldconfig -n $(LIB_DIR); \
133        fi
134
135install_rpobjs: libRpObjects
136        @if test "`uname`" == "Darwin"; then \
137                cp $<.dylib $(libdir); \
138        else \
139                cp -d $<.so* $(libdir); \
140        fi
141
142####################################################################
143
144# include core source files
145
146RpLibrary.o: $(CORE_SRC)/RpLibrary.cc
147        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_CORE2) $(INCL_RP_DEPS)
148
149scew_extras.o: $(CORE_SRC)/scew_extras.c
150        $(CC) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_RP_DEPS)
151
152RpEntityRef.o: $(CORE_SRC)/RpEntityRef.cc
153        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_CORE2)
154
155RpEncode.o: $(CORE_SRC)/RpEncode.cc
156        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_CORE2)
157
158RpUtils.o: $(CORE_SRC)/RpUtils.cc
159        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
160
161RpUnitsStd.o: $(CORE_SRC)/RpUnitsStd.cc
162        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
163
164RpUnits.o: $(CORE_SRC)/RpUnits.cc
165        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
166
167RpBindingsDict.o: $(CORE_SRC)/RpBindingsDict.cc
168        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
169
170
171RpVariable.o: $(CORE_SRC)/RpVariable.cc
172        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
173
174RpAbout.o: $(CORE_SRC)/RpAbout.cc
175        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
176
177RpNumber.o: $(CORE_SRC)/RpNumber.cc
178        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
179
180RpString.o: $(CORE_SRC)/RpString.cc
181        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
182
183RpBoolean.o: $(CORE_SRC)/RpBoolean.cc
184        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
185
186RpChoice.o: $(CORE_SRC)/RpChoice.cc
187        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
188
189RpOption.o: $(CORE_SRC)/RpOption.cc
190        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
191
192RpValue.o: $(CORE_SRC)/RpValue.cc
193        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
194
195RpValueDouble.o: $(CORE_SRC)/RpValueDouble.cc
196        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
197
198RpValueString.o: $(CORE_SRC)/RpValueString.cc
199        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
200
201
202# include cee binding definitions
203
204RpUtilsCInterface.o: $(CEE_SRC)/RpUtilsCInterface.cc
205        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_CEE)
206
207RpUnitsCInterface.o: $(CEE_SRC)/RpUnitsCInterface.cc
208        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_CEE)
209
210RpLibraryCInterface.o: $(CEE_SRC)/RpLibraryCInterface.cc $(CEE_SRC)/RpLibraryCInterface.h $(CEE_SRC)/RpBufferCInterface.h
211        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $< $(INCL_CORE) $(INCL_CORE2) $(INCL_CEE) $(INCL_RP_DEPS)
212
213RpBufferCInterface.o: $(CEE_SRC)/RpBufferCInterface.cc $(CEE_SRC)/RpBufferCInterface.h $(CEE_SRC)/RpOutcomeCInterface.h
214        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $< $(INCL_CORE) $(INCL_CORE2) $(INCL_CEE) $(INCL_RP_DEPS)
215
216RpOutcomeCInterface.o: $(CEE_SRC)/RpOutcomeCInterface.cc
217        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $< $(INCL_CORE) $(INCL_CORE2) $(INCL_CEE) $(INCL_RP_DEPS)
218
219
220
221# include fortran binding definitions
222
223RpUtilsFInterface.o: $(FORT_SRC)/RpUtilsFInterface.cc
224        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_FORTRAN)
225
226RpUnitsFInterface.o: $(FORT_SRC)/RpUnitsFInterface.cc
227        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_FORTRAN)
228
229RpFortranCommon.o: $(FORT_SRC)/RpFortranCommon.cc
230        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $< $(INCL_FORTRAN)
231
232RpLibraryFInterface.o: $(FORT_SRC)/RpLibraryFInterface.cc
233        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_CORE2) $(INCL_FORTRAN) $(INCL_RP_DEPS)
234
235
236docs:
237        if test ! -d docs; then \
238                mkdir docs; \
239        fi
240        if test ! -d docs/doxygen; then \
241                mkdir docs/doxygen; \
242        fi
243        doxygen
244
245#### CLEAN UP ############################################################
246clean:
247        - rm -f *.o librappture.so* librappture.a libRp*.so*
248        - rm -rf build
249
250distclean: clean
251        - rm Makefile
Note: See TracBrowser for help on using the repository browser.