source: trunk/src/Makefile @ 221

Last change on this file since 221 was 192, checked in by dkearney, 18 years ago

1) added nodePath() function to core RpLibrary?, this fxn returns the full·
path of a given element
2) added parent() fxn to core RpLibrary?, this fxn retrieves the parent·
node of a given path
3) added put() fxn to core RpLibrary?, this fxn allows user to put an·
RpLibrary? element into an xml tree at the provided path
4) removed restrictions on not being able to send empty path to put()·
fxns. empty paths will be interpreted as the root of the xml tree.
5) enabled all RpLibrary? objects to include which tryy an object came·
from, adjusted RpLibrary?.h:339. this change will not require/allow·
RpLibrary? Objects to destroy the tree they came from, it is only for·
reference purposes.
6) added new libscew fxn - scew_element_copy, as a low level fxn to copy·
a scew xml element and return a new scew xml element that is not related·
to any xml tree. the new element is created with scew_element_create.·
all attributes and children are also copied to the new element.
7) added new libscew fxn - scew_element_copy_attr, as a low level fxn to·
copy the attributes from one scew element to another scew element.
8) fixed bugs in children() fxn where user is looking for a specific type·
of child, the search hits the end of the list, and fxn failed to check if·
the childNode was null before calling operations on it.
9) adjusted RpLibrary?'s private constructor to set the default value for·
the freeTree flag to 0 (zero). in the cases where we use this private·
constructor, the new objects that are created are only used as reference·
and should not actually be used as real RpLibraries? with real xml trees.

File size: 12.2 KB
Line 
1# you need to change this to where your version of rappture
2# is (or should be) installed.
3RP_INSTALL_BASE = /opt/rappture
4
5# tell make where to find the expat & libscew sources
6INCL_RP_DEPS    = -I$(RP_INSTALL_BASE)/include
7
8#EXPAT_HEADERS   = $(RP_INSTALL_BASE)/include
9#LIB_EXPAT_INCL  = -I $(EXPAT_HEADERS)
10#SCEW_HEADERS    = $(RP_INSTALL_BASE)/include/scew
11#LIB_SCEW_INCL   = -I $(SCEW_HEADERS) -I $(EXPAT_HEADERS)
12
13LIB_SCEW_FLAG   = -L$(RP_INSTALL_BASE)/lib -lscew
14
15#LIB_SCEW_FLAG   = /opt/rappture/lib/libscew.a
16#LIB_SCEW_FLAG   = -static -L/opt/rappture/lib -lscew
17
18
19# everything below should be ok, but check to make sure
20#
21# define the top of our directory structure
22# replace this with the full path of the directory
23# containing the rappture directory
24TOP_DIR         = ../..
25
26# define the top of the rappture directory structure
27RP_BASE   = $(TOP_DIR)/rappture
28
29# define which programs can be made
30PROGS           =   librappture    \
31                    libRpObjects   \
32                    Rappture.Units
33
34# define our compiling environment
35#
36CC              = gcc
37CXX             = g++
38DEBUG           = -g -Wall
39DEBUG_PLUS      = -g -DDEBUG
40PY              = $(RP_INSTALL_BASE)/bin/python
41MEX             = mex
42OCT             = mkoctfile
43LN              = ln
44
45# define our directories
46#
47INCLUDES_DIR    = $(RP_BASE)/include
48BIN_DIR         = $(RP_BASE)/bin
49LIB_DIR         = $(RP_BASE)/src
50SRC_DIR         = $(RP_BASE)/src
51TEST_DIR        = $(RP_BASE)/test
52
53CORE_SRC        = $(SRC_DIR)/core
54FORT_SRC        = $(SRC_DIR)/fortran
55CEE_SRC         = $(SRC_DIR)/cee
56PY_SRC          = $(SRC_DIR)/python
57MATLAB_SRC      = $(SRC_DIR)/matlab
58OCTAVE_SRC      = $(SRC_DIR)/octave
59
60LIB_INC_PREFIX  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR)
61LIB_RP_OBJECTS  = $(LIB_INC_PREFIX) -lRpObjects
62LIB_RAPPTURE    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture
63
64INCL_CORE       = -I$(INCLUDES_DIR)/core
65INCL_CEE        = -I$(INCLUDES_DIR)/cee
66INCL_FORTRAN    = -I$(INCLUDES_DIR)/fortran
67INCL_PY         = -I$(INCLUDES_DIR)/python
68INCL_MATLAB     = -I$(INCLUDES_DIR)/matlab
69INCL_OCTAVE     = -I$(INCLUDES_DIR)/octave
70
71CFLAGS = -fPIC
72
73# default:
74
75all: ${PROGS}
76install: install_py install_rappture install_rpobjs install_matlab install_octave
77
78RP_IO_DEPS      = RpLibrary.o RpLibraryCInterface.o RpLibraryFInterface.o \
79                  scew_extras.o
80RP_UNITS_DEPS   = RpUnitsStd.o RpUnits.o RpUnitsCInterface.o RpUnitsFInterface.o
81RP_OTHER_DEPS   = RpFortranCommon.o RpBindingsDict.o
82RP_OBJS_DEP     = RpVariable.o RpAbout.o RpNumber.o RpString.o RpBoolean.o \
83                  RpChoice.o RpOption.o RpUnitsStd.o RpUnits.o #RpValue.o\
84                  # RpValueDouble.o RpValueString.o
85
86LDLIB_MACOSX = -dynamiclib -o $(LIB_DIR)/$@.dylib
87LDLIB_LINUX = -shared -Wl,-rpath,$(LIB_DIR)/ -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0
88
89# include rappture library definitions
90
91#### librappture shared object ###########################################
92
93librappture: $(RP_IO_DEPS) $(RP_UNITS_DEPS) $(RP_OTHER_DEPS)
94        if test "`uname`" == "Darwin"; then \
95                $(CXX) $(DEGUG) $(LDLIB_MACOSX) $^ $(LIB_SCEW_FLAG) -lm; \
96                ar -r $@.a $^; \
97                ranlib -s $@.a; \
98        else \
99                $(CXX) $(DEGUG) $(LDLIB_LINUX) $^ $(LIB_SCEW_FLAG) -lm; \
100                /sbin/ldconfig -n $(LIB_DIR); \
101                ar -r $@.a $^; \
102                ranlib $@.a; \
103        fi
104
105install_rappture: librappture
106        if test "`uname`" == "Darwin"; then \
107                cp $<.dylib $(RP_INSTALL_BASE)/lib; \
108                cp $<.a $(RP_INSTALL_BASE)/lib; \
109        else \
110                cp -d $<.so* $(RP_INSTALL_BASE)/lib; \
111                cp -d $<.a $(RP_INSTALL_BASE)/lib; \
112        fi
113
114#### libRpObjects ########################################################
115libRpObjects: $(RP_OBJS_DEP)
116        if test "`uname`" == "Darwin"; then \
117                $(CXX) $(DEGUG) $(LDLIB_MACOSX) $^ -lstdc++; \
118        else \
119                $(CXX) $(DEGUG) $(LDLIB_LINUX) $^ -lstdc++; \
120                /sbin/ldconfig -n $(LIB_DIR); \
121        fi
122
123install_rpobjs: libRpObjects
124        if test "`uname`" == "Darwin"; then \
125                cp $<.dylib $(RP_INSTALL_BASE)/lib; \
126        else \
127                cp -d $<.so* $(RP_INSTALL_BASE)/lib; \
128        fi
129
130#### Python ########################################################
131Rappture.Units: RpUnits.o RpUnitsStd.o
132        $(PY) $(PY_SRC)/setup.py build
133
134install_py: RpUnits.o RpUnitsStd.o
135        $(PY) $(PY_SRC)/setup.py install
136
137
138#### Matlab ########################################################
139install_matlab: librappture RpMatlab
140        if test ! -d $(RP_INSTALL_BASE)/lib/matlab; then \
141                mkdir $(RP_INSTALL_BASE)/lib/matlab; \
142        fi
143        cp $(MATLAB_SRC)/*.mex* $(RP_INSTALL_BASE)/lib/matlab
144#       cp -d $(MATLAB_SRC)/*.mex* $(RP_INSTALL_BASE)/lib/matlab
145
146#### Octave ########################################################
147install_octave: librappture RpOctave
148        if test ! -d $(RP_INSTALL_BASE)/lib/octave; then \
149                mkdir $(RP_INSTALL_BASE)/lib/octave; \
150        fi
151        cp $(OCTAVE_SRC)/*.oct* $(RP_INSTALL_BASE)/lib/octave
152#       cp -d $(OCTAVE_SRC)/*.oct* $(RP_INSTALL_BASE)/lib/octave
153
154
155###############################################
156
157# include core source files
158
159RpLibrary.o: $(CORE_SRC)/RpLibrary.cc
160        $(CXX) $(CFLAGS) $(DEBUG) $(INCL_CORE) $(INCL_RP_DEPS) -o $@ -c $?
161
162scew_extras.o: $(CORE_SRC)/scew_extras.c
163        $(CC) $(CFLAGS) $(DEBUG) $(INCL_CORE) $(INCL_RP_DEPS) -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.c
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
230MEX_INCLS = $(INCL_MATLAB) $(INCL_CORE) $(INCL_CEE) $(INCL_RP_DEPS)
231MEX_OPTS = -g -outdir $(MATLAB_SRC) -L$(LIB_DIR) -lrappture $(LIB_SCEW_FLAG)
232MATLAB_COMP_ARGS = $(MATLAB_SRC)/RpMatlabInterface.cc $(MEX_INCLS) $(MEX_OPTS)
233
234RpMatlab:
235        $(MEX) $(MATLAB_SRC)/rpLib.cc                   $(MATLAB_COMP_ARGS)
236        $(MEX) $(MATLAB_SRC)/rpLibXml.cc                $(MATLAB_COMP_ARGS)
237        $(MEX) $(MATLAB_SRC)/rpLibElement.cc            $(MATLAB_COMP_ARGS)
238        $(MEX) $(MATLAB_SRC)/rpLibElementAsObject.cc    $(MATLAB_COMP_ARGS)
239        $(MEX) $(MATLAB_SRC)/rpLibElementAsType.cc      $(MATLAB_COMP_ARGS)
240        $(MEX) $(MATLAB_SRC)/rpLibElementAsComp.cc      $(MATLAB_COMP_ARGS)
241        $(MEX) $(MATLAB_SRC)/rpLibElementAsId.cc        $(MATLAB_COMP_ARGS)
242        $(MEX) $(MATLAB_SRC)/rpLibChildren.cc           $(MATLAB_COMP_ARGS)
243        $(MEX) $(MATLAB_SRC)/rpLibChildrenByType.cc     $(MATLAB_COMP_ARGS)
244#$(MEX) $(MATLAB_SRC)/rpChildrenAsObject.cc         $(MATLAB_COMP_ARGS)
245#$(MEX) $(MATLAB_SRC)/rpChildrenAsType.cc           $(MATLAB_COMP_ARGS)
246#$(MEX) $(MATLAB_SRC)/rpChildrenAsComp.cc           $(MATLAB_COMP_ARGS)
247#$(MEX) $(MATLAB_SRC)/rpChildrenAsId.cc             $(MATLAB_COMP_ARGS)
248        $(MEX) $(MATLAB_SRC)/rpLibGet.cc                $(MATLAB_COMP_ARGS)
249        $(MEX) $(MATLAB_SRC)/rpLibGetString.cc          $(MATLAB_COMP_ARGS)
250        $(MEX) $(MATLAB_SRC)/rpLibGetDouble.cc          $(MATLAB_COMP_ARGS)
251        $(MEX) $(MATLAB_SRC)/rpLibPut.cc                $(MATLAB_COMP_ARGS)
252        $(MEX) $(MATLAB_SRC)/rpLibPutString.cc          $(MATLAB_COMP_ARGS)
253        $(MEX) $(MATLAB_SRC)/rpLibPutDouble.cc          $(MATLAB_COMP_ARGS)
254        $(MEX) $(MATLAB_SRC)/rpLibNodeComp.cc           $(MATLAB_COMP_ARGS)
255        $(MEX) $(MATLAB_SRC)/rpLibNodeType.cc           $(MATLAB_COMP_ARGS)
256        $(MEX) $(MATLAB_SRC)/rpLibNodeId.cc             $(MATLAB_COMP_ARGS)
257        $(MEX) $(MATLAB_SRC)/rpLibResult.cc             $(MATLAB_COMP_ARGS)
258        $(MEX) $(MATLAB_SRC)/rpUnitsDefineUnit.cc       $(MATLAB_COMP_ARGS)
259#$(MEX) $(MATLAB_SRC)/rpDefineConv.cc               $(MATLAB_COMP_ARGS)
260        $(MEX) $(MATLAB_SRC)/rpUnitsGetUnits.cc         $(MATLAB_COMP_ARGS)
261        $(MEX) $(MATLAB_SRC)/rpUnitsGetUnitsName.cc     $(MATLAB_COMP_ARGS)
262        $(MEX) $(MATLAB_SRC)/rpUnitsGetExponent.cc      $(MATLAB_COMP_ARGS)
263        $(MEX) $(MATLAB_SRC)/rpUnitsGetBasis.cc         $(MATLAB_COMP_ARGS)
264        $(MEX) $(MATLAB_SRC)/rpUnitsFind.cc             $(MATLAB_COMP_ARGS)
265        $(MEX) $(MATLAB_SRC)/rpUnitsMakeMetric.cc       $(MATLAB_COMP_ARGS)
266        $(MEX) $(MATLAB_SRC)/rpUnitsConvert.cc          $(MATLAB_COMP_ARGS)
267        $(MEX) $(MATLAB_SRC)/rpUnitsConvertStr.cc       $(MATLAB_COMP_ARGS)
268        $(MEX) $(MATLAB_SRC)/rpUnitsConvertObjStr.cc    $(MATLAB_COMP_ARGS)
269        $(MEX) $(MATLAB_SRC)/rpUnitsConvertDbl.cc       $(MATLAB_COMP_ARGS)
270        $(MEX) $(MATLAB_SRC)/rpUnitsConvertObjDbl.cc    $(MATLAB_COMP_ARGS)
271        $(MEX) $(MATLAB_SRC)/rpAddPresets.cc            $(MATLAB_COMP_ARGS)
272
273OCT_INCLS = $(INCL_OCTAVE) $(INCL_CORE) $(INCL_RP_DEPS)
274OCTAVE_COMP_ARGS = $(OCT_INCLS) -L$(LIB_DIR) -lrappture $(LIB_SCEW_FLAG)
275RpOctave:
276        $(OCT) $(OCTAVE_SRC)/rpAddPresets.cc            $(OCTAVE_COMP_ARGS)
277        $(OCT) $(OCTAVE_SRC)/rpLib.cc                   $(OCTAVE_COMP_ARGS)
278        $(OCT) $(OCTAVE_SRC)/rpLibChildrenByType.cc     $(OCTAVE_COMP_ARGS)
279        $(OCT) $(OCTAVE_SRC)/rpLibChildren.cc           $(OCTAVE_COMP_ARGS)
280        $(OCT) $(OCTAVE_SRC)/rpLibElementAsComp.cc      $(OCTAVE_COMP_ARGS)
281        $(OCT) $(OCTAVE_SRC)/rpLibElementAsId.cc        $(OCTAVE_COMP_ARGS)
282        $(OCT) $(OCTAVE_SRC)/rpLibElementAsObject.cc    $(OCTAVE_COMP_ARGS)
283        $(OCT) $(OCTAVE_SRC)/rpLibElementAsType.cc      $(OCTAVE_COMP_ARGS)
284        $(OCT) $(OCTAVE_SRC)/rpLibElement.cc            $(OCTAVE_COMP_ARGS)
285        $(OCT) $(OCTAVE_SRC)/rpLibGet.cc                $(OCTAVE_COMP_ARGS)
286        $(OCT) $(OCTAVE_SRC)/rpLibGetString.cc          $(OCTAVE_COMP_ARGS)
287        $(OCT) $(OCTAVE_SRC)/rpLibGetDouble.cc          $(OCTAVE_COMP_ARGS)
288        $(OCT) $(OCTAVE_SRC)/rpLibNodeComp.cc           $(OCTAVE_COMP_ARGS)
289        $(OCT) $(OCTAVE_SRC)/rpLibNodeId.cc             $(OCTAVE_COMP_ARGS)
290        $(OCT) $(OCTAVE_SRC)/rpLibNodeType.cc           $(OCTAVE_COMP_ARGS)
291        $(OCT) $(OCTAVE_SRC)/rpLibPut.cc                $(OCTAVE_COMP_ARGS)
292        $(OCT) $(OCTAVE_SRC)/rpLibPutDouble.cc          $(OCTAVE_COMP_ARGS)
293        $(OCT) $(OCTAVE_SRC)/rpLibPutString.cc          $(OCTAVE_COMP_ARGS)
294        $(OCT) $(OCTAVE_SRC)/rpLibResult.cc             $(OCTAVE_COMP_ARGS)
295        $(OCT) $(OCTAVE_SRC)/rpLibXml.cc                $(OCTAVE_COMP_ARGS)
296        $(OCT) $(OCTAVE_SRC)/rpUnitsConvert.cc          $(OCTAVE_COMP_ARGS)
297        $(OCT) $(OCTAVE_SRC)/rpUnitsConvertDbl.cc       $(OCTAVE_COMP_ARGS)
298        $(OCT) $(OCTAVE_SRC)/rpUnitsConvertStr.cc       $(OCTAVE_COMP_ARGS)
299        $(OCT) $(OCTAVE_SRC)/rpUnitsConvertObjDbl.cc    $(OCTAVE_COMP_ARGS)
300        $(OCT) $(OCTAVE_SRC)/rpUnitsConvertObjStr.cc    $(OCTAVE_COMP_ARGS)
301        $(OCT) $(OCTAVE_SRC)/rpUnitsDefineUnit.cc       $(OCTAVE_COMP_ARGS)
302        $(OCT) $(OCTAVE_SRC)/rpUnitsFind.cc             $(OCTAVE_COMP_ARGS)
303        $(OCT) $(OCTAVE_SRC)/rpUnitsGetBasis.cc         $(OCTAVE_COMP_ARGS)
304        $(OCT) $(OCTAVE_SRC)/rpUnitsGetExponent.cc      $(OCTAVE_COMP_ARGS)
305        $(OCT) $(OCTAVE_SRC)/rpUnitsGetUnits.cc         $(OCTAVE_COMP_ARGS)
306        $(OCT) $(OCTAVE_SRC)/rpUnitsGetUnitsName.cc     $(OCTAVE_COMP_ARGS)
307        $(OCT) $(OCTAVE_SRC)/rpUnitsMakeMetric.cc       $(OCTAVE_COMP_ARGS)
308
309docs:
310        if test ! -d docs; then \
311                mkdir docs; \
312        fi
313        if test ! -d docs/doxygen; then \
314                mkdir docs/doxygen; \
315        fi
316        doxygen
317
318#### CLEAN UP ############################################################
319clean:
320        - rm -f *.o librappture.so* librappture.a libRp*.so* rp*.mex* $(OCTAVE_SRC)/rp*.o*
321        - rm -rf build
Note: See TracBrowser for help on using the repository browser.