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 | CPP = 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 RpUnitsStd.o RpUnits.o |
---|
96 | $(CPP) $(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 | $(CPP) $(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 | Rp%.o: $(CORE_SRC)/Rp%.cc |
---|
113 | $(CPP) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
114 | |
---|
115 | # include cee binding definitions |
---|
116 | |
---|
117 | rappture_interface.o: $(CEE_SRC)/rappture_interface.c |
---|
118 | $(CPP) -fPIC $(DEBUG) $(INCL_CEE) $(INCL_PY) -o $@ -c $< |
---|
119 | |
---|
120 | RpUnitsCInterface.o: $(CEE_SRC)/RpUnitsCInterface.cc |
---|
121 | $(CPP) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) -o $@ -c $? |
---|
122 | |
---|
123 | # include fortran binding definitions |
---|
124 | |
---|
125 | RpUnits_fortran.o: $(FORT_SRC)/RpUnits_fortran.c |
---|
126 | $(CPP) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $? |
---|
127 | |
---|
128 | rappture_fortran.o: $(FORT_SRC)/rappture_fortran.c |
---|
129 | $(CPP) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) $(INCL_PY) -o $@ -c $< |
---|
130 | |
---|
131 | #### CLEAN UP ############################################################ |
---|
132 | clean: |
---|
133 | - rm -f $(BIN_DIR)/* *.o librappture.* libR*.so* |
---|