source: trunk/src/Makefile @ 91

Last change on this file since 91 was 90, checked in by dkearney, 18 years ago

adjusted the c-example which include a c example and a c++ example
also changed RpLibrary?.h to look for the scew library in the scew directory.

File size: 5.4 KB
Line 
1# you need to change this to where your version of python is installed.
2# tell make where to find python header files
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              = python
41
42LN              = ln
43
44# define our directories
45#
46INCLUDES_DIR    = $(RP_BASE)/include
47BIN_DIR         = $(RP_BASE)/bin
48LIB_DIR         = $(RP_BASE)/src
49SRC_DIR         = $(RP_BASE)/src
50TEST_DIR        = $(RP_BASE)/test
51
52CORE_SRC        = $(SRC_DIR)/core
53FORT_SRC        = $(SRC_DIR)/fortran
54CEE_SRC         = $(SRC_DIR)/cee
55PY_SRC          = $(SRC_DIR)/python
56
57LIB_INC_PREFIX  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR)
58LIB_RP_OBJECTS  = $(LIB_INC_PREFIX) -lRpObjects
59LIB_RAPPTURE    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture
60
61INCL_CORE       = -I $(INCLUDES_DIR)/core
62INCL_CEE        = -I $(INCLUDES_DIR)/cee
63INCL_FORTRAN    = -I $(INCLUDES_DIR)/fortran
64INCL_PY         = -I $(INCLUDES_DIR)/python
65
66
67# default:
68
69all: ${PROGS}
70install: all install_py install_rappture install_rpobjs
71
72RP_IO_DEPS      = RpLibrary.o RpLibraryCInterface.o RpLibraryFInterface.o \
73                  scew_extras.o
74RP_UNITS_DEPS   = RpUnitsStd.o RpUnits.o RpUnitsCInterface.o RpUnitsFInterface.o
75RP_OTHER_DEPS   = RpFortranCommon.o # RpBindingsDict.o
76RP_OBJS_DEP     = RpVariable.o RpAbout.o RpNumber.o RpString.o RpBoolean.o \
77                  RpChoice.o RpOption.o RpUnitsStd.o RpUnits.o
78
79# include rappture library definitions
80
81#### librappture shared object ###########################################
82
83librappture: $(RP_IO_DEPS) $(RP_UNITS_DEPS) $(RP_OTHER_DEPS)
84        $(CXX) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
85                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ $(LIB_SCEW_FLAG)
86
87        /sbin/ldconfig -n $(LIB_DIR)
88
89install_rappture: librappture
90        cp -d $<.so* $(RP_INSTALL_BASE)/lib
91
92#### libRpObjects ########################################################
93libRpObjects: $(RP_OBJS_DEP)
94        $(CC) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
95                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ -lstdc++
96#       $(CXX) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
97#               -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^
98       
99        /sbin/ldconfig -n $(LIB_DIR)
100
101install_rpobjs: libRpObjects
102        cp -d $<.so* $(RP_INSTALL_BASE)/lib
103
104#### Python ########################################################
105Rappture.Units: RpUnits.o RpUnitsStd.o
106        $(PY) $(PY_SRC)/setup.py build
107
108install_py: RpUnits.o RpUnitsStd.o
109        $(PY) $(PY_SRC)/setup.py install
110
111
112
113# include core source files
114
115RpLibrary.o: $(CORE_SRC)/RpLibrary.cc
116        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_RP_DEPS) -o $@ -c $?
117
118scew_extras.o: $(CORE_SRC)/scew_extras.c
119        $(CC) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_RP_DEPS) -o $@ -c $?
120
121RpVariable.o: $(CORE_SRC)/RpVariable.cc
122        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
123
124RpAbout.o: $(CORE_SRC)/RpAbout.cc
125        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
126
127RpNumber.o: $(CORE_SRC)/RpNumber.cc
128        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
129
130RpString.o: $(CORE_SRC)/RpString.cc
131        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
132
133RpBoolean.o: $(CORE_SRC)/RpBoolean.cc
134        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
135
136RpChoice.o: $(CORE_SRC)/RpChoice.cc
137        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
138
139RpOption.o: $(CORE_SRC)/RpOption.cc
140        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
141
142RpUnitsStd.o: $(CORE_SRC)/RpUnitsStd.cc
143        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
144
145RpUnits.o: $(CORE_SRC)/RpUnits.cc
146        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
147
148RpBindingsDict.o: $(CORE_SRC)/RpBindingsDict.cc
149        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
150
151
152
153
154# include cee binding definitions
155
156rappture_interface.o: $(CEE_SRC)/rappture_interface.c
157        $(CXX) -fPIC $(DEBUG) $(INCL_CEE) $(INCL_PY) -o $@ -c $<
158
159RpUnitsCInterface.o: $(CEE_SRC)/RpUnitsCInterface.cc
160        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) -o $@ -c $?
161
162RpLibraryCInterface.o: $(CEE_SRC)/RpLibraryCInterface.cc
163        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) $(INCL_RP_DEPS) -o $@ -c $?
164
165
166
167
168# include fortran binding definitions
169
170rappture_fortran.o: $(FORT_SRC)/rappture_fortran.c
171        $(CXX) -fPIC $(DEBUG) $(INCL_FORTRAN) $(INCL_CORE) $(INCL_CEE) $(INCL_PY) -o $@ -c $<
172
173RpUnitsFInterface.o: $(FORT_SRC)/RpUnitsFInterface.cc
174        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_FORTRAN) -o $@ -c $?
175
176RpFortranCommon.o: $(FORT_SRC)/RpFortranCommon.c
177        $(CXX) -fPIC $(DEBUG) $(INCL_FORTRAN) -o $@ -c $<
178
179RpLibraryFInterface.o: $(FORT_SRC)/RpLibraryFInterface.cc
180        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_FORTRAN) $(INCL_RP_DEPS) -o $@ -c $?
181
182
183
184
185#### CLEAN UP ############################################################
186clean:
187        - rm -f *.o librappture.so* libRp*.so*
188        - rm -rf build
Note: See TracBrowser for help on using the repository browser.