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 expat & libscew sources |
---|
6 | INCL_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 | |
---|
13 | LIB_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 |
---|
24 | TOP_DIR = ../.. |
---|
25 | |
---|
26 | # define the top of the rappture directory structure |
---|
27 | RP_BASE = $(TOP_DIR)/rappture |
---|
28 | |
---|
29 | # define which programs can be made |
---|
30 | PROGS = librappture \ |
---|
31 | libRpObjects \ |
---|
32 | Rappture.Units |
---|
33 | |
---|
34 | # define our compiling environment |
---|
35 | # |
---|
36 | CC = gcc |
---|
37 | CXX = g++ |
---|
38 | DEBUG = -g -Wall |
---|
39 | DEBUG_PLUS = -g -DDEBUG |
---|
40 | PY = python |
---|
41 | |
---|
42 | LN = ln |
---|
43 | |
---|
44 | # define our directories |
---|
45 | # |
---|
46 | INCLUDES_DIR = $(RP_BASE)/include |
---|
47 | BIN_DIR = $(RP_BASE)/bin |
---|
48 | LIB_DIR = $(RP_BASE)/src |
---|
49 | SRC_DIR = $(RP_BASE)/src |
---|
50 | TEST_DIR = $(RP_BASE)/test |
---|
51 | |
---|
52 | CORE_SRC = $(SRC_DIR)/core |
---|
53 | FORT_SRC = $(SRC_DIR)/fortran |
---|
54 | CEE_SRC = $(SRC_DIR)/cee |
---|
55 | PY_SRC = $(SRC_DIR)/python |
---|
56 | |
---|
57 | LIB_INC_PREFIX = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) |
---|
58 | LIB_RP_OBJECTS = $(LIB_INC_PREFIX) -lRpObjects |
---|
59 | LIB_RAPPTURE = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture |
---|
60 | |
---|
61 | INCL_CORE = -I $(INCLUDES_DIR)/core |
---|
62 | INCL_CEE = -I $(INCLUDES_DIR)/cee |
---|
63 | INCL_FORTRAN = -I $(INCLUDES_DIR)/fortran |
---|
64 | INCL_PY = -I $(INCLUDES_DIR)/python |
---|
65 | |
---|
66 | |
---|
67 | # default: |
---|
68 | |
---|
69 | all: ${PROGS} |
---|
70 | install: all install_py install_rappture install_rpobjs |
---|
71 | |
---|
72 | RP_IO_DEPS = RpLibrary.o RpLibraryCInterface.o RpLibraryFInterface.o \ |
---|
73 | scew_extras.o |
---|
74 | RP_UNITS_DEPS = RpUnitsStd.o RpUnits.o RpUnitsCInterface.o RpUnitsFInterface.o |
---|
75 | RP_OTHER_DEPS = RpFortranCommon.o # RpBindingsDict.o |
---|
76 | RP_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 | |
---|
83 | librappture: $(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 | |
---|
89 | install_rappture: librappture |
---|
90 | cp -d $<.so* $(RP_INSTALL_BASE)/lib |
---|
91 | |
---|
92 | #### libRpObjects ######################################################## |
---|
93 | libRpObjects: $(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 | |
---|
101 | install_rpobjs: libRpObjects |
---|
102 | cp -d $<.so* $(RP_INSTALL_BASE)/lib |
---|
103 | |
---|
104 | #### Python ######################################################## |
---|
105 | Rappture.Units: RpUnits.o RpUnitsStd.o |
---|
106 | $(PY) $(PY_SRC)/setup.py build |
---|
107 | |
---|
108 | install_py: RpUnits.o RpUnitsStd.o |
---|
109 | $(PY) $(PY_SRC)/setup.py install |
---|
110 | |
---|
111 | |
---|
112 | |
---|
113 | # include core source files |
---|
114 | |
---|
115 | RpLibrary.o: $(CORE_SRC)/RpLibrary.cc |
---|
116 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_RP_DEPS) -o $@ -c $? |
---|
117 | |
---|
118 | scew_extras.o: $(CORE_SRC)/scew_extras.c |
---|
119 | $(CC) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_RP_DEPS) -o $@ -c $? |
---|
120 | |
---|
121 | RpVariable.o: $(CORE_SRC)/RpVariable.cc |
---|
122 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
123 | |
---|
124 | RpAbout.o: $(CORE_SRC)/RpAbout.cc |
---|
125 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
126 | |
---|
127 | RpNumber.o: $(CORE_SRC)/RpNumber.cc |
---|
128 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
129 | |
---|
130 | RpString.o: $(CORE_SRC)/RpString.cc |
---|
131 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
132 | |
---|
133 | RpBoolean.o: $(CORE_SRC)/RpBoolean.cc |
---|
134 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
135 | |
---|
136 | RpChoice.o: $(CORE_SRC)/RpChoice.cc |
---|
137 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
138 | |
---|
139 | RpOption.o: $(CORE_SRC)/RpOption.cc |
---|
140 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
141 | |
---|
142 | RpUnitsStd.o: $(CORE_SRC)/RpUnitsStd.cc |
---|
143 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
144 | |
---|
145 | RpUnits.o: $(CORE_SRC)/RpUnits.cc |
---|
146 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
147 | |
---|
148 | RpBindingsDict.o: $(CORE_SRC)/RpBindingsDict.cc |
---|
149 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
150 | |
---|
151 | |
---|
152 | |
---|
153 | |
---|
154 | # include cee binding definitions |
---|
155 | |
---|
156 | rappture_interface.o: $(CEE_SRC)/rappture_interface.c |
---|
157 | $(CXX) -fPIC $(DEBUG) $(INCL_CEE) $(INCL_PY) -o $@ -c $< |
---|
158 | |
---|
159 | RpUnitsCInterface.o: $(CEE_SRC)/RpUnitsCInterface.cc |
---|
160 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) -o $@ -c $? |
---|
161 | |
---|
162 | RpLibraryCInterface.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 | |
---|
170 | rappture_fortran.o: $(FORT_SRC)/rappture_fortran.c |
---|
171 | $(CXX) -fPIC $(DEBUG) $(INCL_FORTRAN) $(INCL_CORE) $(INCL_CEE) $(INCL_PY) -o $@ -c $< |
---|
172 | |
---|
173 | RpUnitsFInterface.o: $(FORT_SRC)/RpUnitsFInterface.cc |
---|
174 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_FORTRAN) -o $@ -c $? |
---|
175 | |
---|
176 | RpFortranCommon.o: $(FORT_SRC)/RpFortranCommon.c |
---|
177 | $(CXX) -fPIC $(DEBUG) $(INCL_FORTRAN) -o $@ -c $< |
---|
178 | |
---|
179 | RpLibraryFInterface.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 ############################################################ |
---|
186 | clean: |
---|
187 | - rm -f *.o librappture.so* libRp*.so* |
---|
188 | - rm -rf build |
---|