1 | # you need to change this to where your version of python is installed. |
---|
2 | # tell make where to find python header files |
---|
3 | PY_SRC_HEADERS = /opt/rappture/include/python2.4 |
---|
4 | |
---|
5 | # tell make where to find the python shared library |
---|
6 | EMB_PY_LIB_FLAG = -lpython2.4 |
---|
7 | EMB_PY_LIB_DIR = /opt/rappture/lib |
---|
8 | |
---|
9 | EMB_PY_FLAGS = -Wl,-rpath,$(EMB_PY_LIB_DIR) -L$(EMB_PY_LIB_DIR) $(EMB_PY_LIB_FLAG) |
---|
10 | |
---|
11 | # everything below should be ok, but check to make sure |
---|
12 | # especially check the fortran flags, if youre using fortran |
---|
13 | # |
---|
14 | # define the top of our directory structure |
---|
15 | # replace this with the full path of the directory |
---|
16 | # containing the rappture directory |
---|
17 | TOP_DIR = ../.. |
---|
18 | |
---|
19 | # define the top of the rappture directory structure |
---|
20 | RP_BASE = $(TOP_DIR)/rappture |
---|
21 | |
---|
22 | # define which programs can be made |
---|
23 | PROGS = librappture \ |
---|
24 | libRpObjects \ |
---|
25 | |
---|
26 | # define our compiling environment |
---|
27 | # |
---|
28 | CC = gcc |
---|
29 | CXX = g++ |
---|
30 | DEBUG = -g -Wall |
---|
31 | DEBUG_PLUS = -g -DDEBUG |
---|
32 | |
---|
33 | # FORTRAN BINDINGS COMPILER FLAGS |
---|
34 | # |
---|
35 | # available flags |
---|
36 | # |
---|
37 | # COMPNAME_NOCHANGE - No change to the Rappture Library function |
---|
38 | # name |
---|
39 | # COMPNAME_UPPERCASE - Replace the Rappture Library function name |
---|
40 | # with an all uppercase version of the name |
---|
41 | # COMPNAME_ADD1UNDERSCORE - add 1 underscore to the end of the Rappture |
---|
42 | # Library function name |
---|
43 | # COMPNAME_ADD2UNDERSCORE - add 2 underscores to the end of the Rappture |
---|
44 | # Library function name |
---|
45 | # |
---|
46 | # when setting CFLAGS, use the following guide for help |
---|
47 | # |
---|
48 | # gnu's g77/f77 COMPNAME_ADD2UNDERSCORE |
---|
49 | # absoft's f77 COMPNAME_ADD1UNDERSCORE |
---|
50 | # intel's ifort COMPNAME_ADD1UNDERSCORE |
---|
51 | # intel's mpif90 COMPNAME_ADD1UNDERSCORE |
---|
52 | # |
---|
53 | # |
---|
54 | |
---|
55 | CFLAGS = -DCOMPNAME_ADD2UNDERSCORE |
---|
56 | |
---|
57 | F77 = g77 |
---|
58 | #F77 = f77 |
---|
59 | #F77 = ifort |
---|
60 | #F77 = /opt/mpich-1.2.6/p4-intel/bin/mpif90 |
---|
61 | |
---|
62 | LN = ln |
---|
63 | |
---|
64 | # define our directories |
---|
65 | # |
---|
66 | INCLUDES_DIR = $(RP_BASE)/include |
---|
67 | BIN_DIR = $(RP_BASE)/bin |
---|
68 | LIB_DIR = $(RP_BASE)/src |
---|
69 | SRC_DIR = $(RP_BASE)/src |
---|
70 | TEST_DIR = $(RP_BASE)/test |
---|
71 | |
---|
72 | CORE_SRC = $(SRC_DIR)/core |
---|
73 | FORT_SRC = $(SRC_DIR)/fortran |
---|
74 | CEE_SRC = $(SRC_DIR)/cee |
---|
75 | PY_SRC = $(SRC_DIR)/python |
---|
76 | |
---|
77 | LIB_INC_PREFIX = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) |
---|
78 | LIB_RP_OBJECTS = $(LIB_INC_PREFIX) -lRpObjects |
---|
79 | LIB_RAPPTURE = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture |
---|
80 | |
---|
81 | INCL_CORE = -I $(INCLUDES_DIR)/core |
---|
82 | INCL_CEE = -I $(INCLUDES_DIR)/cee -I $(PY_SRC_HEADERS) |
---|
83 | INCL_FORTRAN = -I $(INCLUDES_DIR)/fortran |
---|
84 | INCL_PY = -I $(INCLUDES_DIR)/python |
---|
85 | |
---|
86 | |
---|
87 | # default: |
---|
88 | |
---|
89 | all: ${PROGS} |
---|
90 | |
---|
91 | # include rappture library definitions |
---|
92 | |
---|
93 | #### librappture shared object ########################################### |
---|
94 | |
---|
95 | librappture: rappture_fortran.o rappture_interface.o RpUnitsCInterface.o RpUnitsFInterface.o RpFortranCommon.o RpUnitsStd.o RpUnits.o |
---|
96 | $(CXX) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \ |
---|
97 | -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ $(EMB_PY_FLAGS) |
---|
98 | |
---|
99 | /sbin/ldconfig -n $(LIB_DIR) |
---|
100 | |
---|
101 | |
---|
102 | #### libRpObjects ######################################################## |
---|
103 | libRpObjects: RpVariable.o RpAbout.o RpNumber.o RpString.o RpBoolean.o RpChoice.o RpOption.o RpUnitsStd.o RpUnits.o |
---|
104 | $(CXX) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \ |
---|
105 | -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ -lc |
---|
106 | |
---|
107 | /sbin/ldconfig -n $(LIB_DIR) |
---|
108 | |
---|
109 | |
---|
110 | # include core source files |
---|
111 | |
---|
112 | RpVariable.o: $(CORE_SRC)/RpVariable.cc |
---|
113 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
114 | |
---|
115 | RpAbout.o: $(CORE_SRC)/RpAbout.cc |
---|
116 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
117 | |
---|
118 | RpNumber.o: $(CORE_SRC)/RpNumber.cc |
---|
119 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
120 | |
---|
121 | RpString.o: $(CORE_SRC)/RpString.cc |
---|
122 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
123 | |
---|
124 | RpBoolean.o: $(CORE_SRC)/RpBoolean.cc |
---|
125 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
126 | |
---|
127 | RpChoice.o: $(CORE_SRC)/RpChoice.cc |
---|
128 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
129 | |
---|
130 | RpOption.o: $(CORE_SRC)/RpOption.cc |
---|
131 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
132 | |
---|
133 | RpUnitsStd.o: $(CORE_SRC)/RpUnitsStd.cc |
---|
134 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
135 | |
---|
136 | RpUnits.o: $(CORE_SRC)/RpUnits.cc |
---|
137 | $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
138 | |
---|
139 | |
---|
140 | |
---|
141 | |
---|
142 | # include cee binding definitions |
---|
143 | |
---|
144 | rappture_interface.o: $(CEE_SRC)/rappture_interface.c |
---|
145 | $(CXX) -fPIC $(DEBUG) $(INCL_CEE) $(INCL_PY) -o $@ -c $< |
---|
146 | |
---|
147 | RpUnitsCInterface.o: $(CEE_SRC)/RpUnitsCInterface.cc |
---|
148 | $(CXX) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) -o $@ -c $? |
---|
149 | |
---|
150 | |
---|
151 | |
---|
152 | |
---|
153 | # include fortran binding definitions |
---|
154 | |
---|
155 | rappture_fortran.o: $(FORT_SRC)/rappture_fortran.c |
---|
156 | $(CXX) $(CFLAGS) -fPIC $(DEBUG) $(INCL_FORTRAN) $(INCL_CORE) $(INCL_CEE) $(INCL_PY) -o $@ -c $< |
---|
157 | |
---|
158 | RpUnitsFInterface.o: $(FORT_SRC)/RpUnitsFInterface.cc |
---|
159 | $(CXX) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_FORTRAN) -o $@ -c $? |
---|
160 | |
---|
161 | RpFortranCommon.o: $(FORT_SRC)/RpFortranCommon.c |
---|
162 | $(CC) $(CFLAGS) -fPIC $(DEBUG) $(INCL_FORTRAN) -o $@ -c $< |
---|
163 | |
---|
164 | |
---|
165 | |
---|
166 | |
---|
167 | #### CLEAN UP ############################################################ |
---|
168 | clean: |
---|
169 | - rm -f $(BIN_DIR)/* *.o librappture.* libR*.so* |
---|