1 | # you need to change this to where your version of python is installed. |
---|
2 | # tell make where to find python header files |
---|
3 | RP_INSTALL_BASE = /opt/rappture |
---|
4 | |
---|
5 | # tell make where to find the libscew sources |
---|
6 | EXPAT_HEADERS = /opt/rappture/include |
---|
7 | LIB_EXPAT_INCL = -I $(EXPAT_HEADERS) |
---|
8 | SCEW_HEADERS = /opt/rappture/include/scew |
---|
9 | LIB_SCEW_INCL = -I $(SCEW_HEADERS) -I $(EXPAT_HEADERS) |
---|
10 | LIB_SCEW_FLAG = -L/opt/rappture/lib -lscew |
---|
11 | #LIB_SCEW_FLAG = /opt/rappture/lib/libscew.a |
---|
12 | #LIB_SCEW_FLAG = -static -L/opt/rappture/lib -lscew |
---|
13 | |
---|
14 | |
---|
15 | # everything below should be ok, but check to make sure |
---|
16 | # |
---|
17 | # define the top of our directory structure |
---|
18 | # replace this with the full path of the directory |
---|
19 | # containing the rappture directory |
---|
20 | TOP_DIR = ../.. |
---|
21 | |
---|
22 | # define the top of the rappture directory structure |
---|
23 | RP_BASE = $(TOP_DIR)/svn.rappture |
---|
24 | |
---|
25 | # define which programs can be made |
---|
26 | PROGS = librappture \ |
---|
27 | libRpObjects \ |
---|
28 | Rappture.Units |
---|
29 | |
---|
30 | # define our compiling environment |
---|
31 | # |
---|
32 | CC = gcc |
---|
33 | CXX = g++ |
---|
34 | DEBUG = -g -Wall |
---|
35 | DEBUG_PLUS = -g -DDEBUG |
---|
36 | PY = python |
---|
37 | |
---|
38 | LN = ln |
---|
39 | |
---|
40 | # define our directories |
---|
41 | # |
---|
42 | INCLUDES_DIR = $(RP_BASE)/include |
---|
43 | BIN_DIR = $(RP_BASE)/bin |
---|
44 | LIB_DIR = $(RP_BASE)/src |
---|
45 | SRC_DIR = $(RP_BASE)/src |
---|
46 | TEST_DIR = $(RP_BASE)/test |
---|
47 | |
---|
48 | CORE_SRC = $(SRC_DIR)/core |
---|
49 | FORT_SRC = $(SRC_DIR)/fortran |
---|
50 | CEE_SRC = $(SRC_DIR)/cee |
---|
51 | PY_SRC = $(SRC_DIR)/python |
---|
52 | |
---|
53 | LIB_INC_PREFIX = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) |
---|
54 | LIB_RP_OBJECTS = $(LIB_INC_PREFIX) -lRpObjects |
---|
55 | LIB_RAPPTURE = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture |
---|
56 | |
---|
57 | INCL_CORE = -I $(INCLUDES_DIR)/core |
---|
58 | INCL_CEE = -I $(INCLUDES_DIR)/cee |
---|
59 | INCL_FORTRAN = -I $(INCLUDES_DIR)/fortran |
---|
60 | INCL_PY = -I $(INCLUDES_DIR)/python |
---|
61 | |
---|
62 | |
---|
63 | # default: |
---|
64 | |
---|
65 | all: ${PROGS} |
---|
66 | install: all install_py install_rappture install_rpobjs |
---|
67 | |
---|
68 | RP_IO_DEPS = RpLibrary.o RpLibraryCInterface.o RpLibraryFInterface.o \ |
---|
69 | scew_extras.o |
---|
70 | RP_UNITS_DEPS = RpUnitsStd.o RpUnits.o RpUnitsCInterface.o RpUnitsFInterface.o |
---|
71 | RP_OTHER_DEPS = RpFortranCommon.o |
---|
72 | RP_OBJS_DEP = RpVariable.o RpAbout.o RpNumber.o RpString.o RpBoolean.o \ |
---|
73 | RpChoice.o RpOption.o RpUnitsStd.o RpUnits.o |
---|
74 | |
---|
75 | # include rappture library definitions |
---|
76 | |
---|
77 | #### librappture shared object ########################################### |
---|
78 | |
---|
79 | librappture: $(RP_IO_DEPS) $(RP_UNITS_DEPS) $(RP_OTHER_DEPS) |
---|
80 | $(CXX) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \ |
---|
81 | -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ $(LIB_SCEW_FLAG) |
---|
82 | |
---|
83 | /sbin/ldconfig -n $(LIB_DIR) |
---|
84 | |
---|
85 | install_rappture: librappture |
---|
86 | cp -d $<.so* $(RP_INSTALL_BASE)/lib |
---|
87 | |
---|
88 | #### libRpObjects ######################################################## |
---|
89 | libRpObjects: $(RP_OBJS_DEP) |
---|
90 | $(CC) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \ |
---|
91 | -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ -lstdc++ |
---|
92 | # $(CXX) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \ |
---|
93 | # -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ |
---|
94 | |
---|
95 | /sbin/ldconfig -n $(LIB_DIR) |
---|
96 | |
---|
97 | install_rpobjs: libRpObjects |
---|
98 | cp -d $<.so* $(RP_INSTALL_BASE)/lib |
---|
99 | |
---|
100 | #### Python ######################################################## |
---|
101 | Rappture.Units: RpUnits.o RpUnitsStd.o |
---|
102 | $(PY) $(PY_SRC)/setup.py build |
---|
103 | |
---|
104 | install_py: RpUnits.o RpUnitsStd.o |
---|
105 | $(PY) $(PY_SRC)/setup.py install |
---|
106 | |
---|
107 | |
---|
108 | |
---|
109 | # include core source files |
---|
110 | |
---|
111 | RpLibrary.o: $(CORE_SRC)/RpLibrary.cc |
---|
112 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(LIB_SCEW_INCL) -o $@ -c $? |
---|
113 | |
---|
114 | scew_extras.o: $(CORE_SRC)/scew_extras.c |
---|
115 | $(CC) -fPIC $(DEBUG) $(INCL_CORE) $(LIB_SCEW_INCL) -o $@ -c $? |
---|
116 | |
---|
117 | RpVariable.o: $(CORE_SRC)/RpVariable.cc |
---|
118 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
119 | |
---|
120 | RpAbout.o: $(CORE_SRC)/RpAbout.cc |
---|
121 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
122 | |
---|
123 | RpNumber.o: $(CORE_SRC)/RpNumber.cc |
---|
124 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
125 | |
---|
126 | RpString.o: $(CORE_SRC)/RpString.cc |
---|
127 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
128 | |
---|
129 | RpBoolean.o: $(CORE_SRC)/RpBoolean.cc |
---|
130 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
131 | |
---|
132 | RpChoice.o: $(CORE_SRC)/RpChoice.cc |
---|
133 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
134 | |
---|
135 | RpOption.o: $(CORE_SRC)/RpOption.cc |
---|
136 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
137 | |
---|
138 | RpUnitsStd.o: $(CORE_SRC)/RpUnitsStd.cc |
---|
139 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
140 | |
---|
141 | RpUnits.o: $(CORE_SRC)/RpUnits.cc |
---|
142 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
143 | |
---|
144 | |
---|
145 | |
---|
146 | |
---|
147 | # include cee binding definitions |
---|
148 | |
---|
149 | rappture_interface.o: $(CEE_SRC)/rappture_interface.c |
---|
150 | $(CXX) -fPIC $(DEBUG) $(INCL_CEE) $(INCL_PY) -o $@ -c $< |
---|
151 | |
---|
152 | RpUnitsCInterface.o: $(CEE_SRC)/RpUnitsCInterface.cc |
---|
153 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) -o $@ -c $? |
---|
154 | |
---|
155 | RpLibraryCInterface.o: $(CEE_SRC)/RpLibraryCInterface.cc |
---|
156 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) $(LIB_SCEW_INCL) -o $@ -c $? |
---|
157 | |
---|
158 | |
---|
159 | |
---|
160 | |
---|
161 | # include fortran binding definitions |
---|
162 | |
---|
163 | rappture_fortran.o: $(FORT_SRC)/rappture_fortran.c |
---|
164 | $(CXX) -fPIC $(DEBUG) $(INCL_FORTRAN) $(INCL_CORE) $(INCL_CEE) $(INCL_PY) -o $@ -c $< |
---|
165 | |
---|
166 | RpUnitsFInterface.o: $(FORT_SRC)/RpUnitsFInterface.cc |
---|
167 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_FORTRAN) -o $@ -c $? |
---|
168 | |
---|
169 | RpFortranCommon.o: $(FORT_SRC)/RpFortranCommon.c |
---|
170 | $(CXX) -fPIC $(DEBUG) $(INCL_FORTRAN) -o $@ -c $< |
---|
171 | |
---|
172 | RpLibraryFInterface.o: $(FORT_SRC)/RpLibraryFInterface.cc |
---|
173 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_FORTRAN) $(LIB_SCEW_INCL) -o $@ -c $? |
---|
174 | |
---|
175 | |
---|
176 | |
---|
177 | |
---|
178 | #### CLEAN UP ############################################################ |
---|
179 | clean: |
---|
180 | - rm -f *.o librappture.so* libRp*.so* |
---|
181 | - rm -rf build |
---|