source: trunk/src/Makefile.in @ 493

Last change on this file since 493 was 491, checked in by dkearney, 18 years ago

testing installing python modules to temporary location using --prefix flag so we dont need to include a whole python distribution in our package

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