source: trunk/src/Makefile @ 77

Last change on this file since 77 was 77, checked in by dkearney, 15 years ago
  1. initial checkin of RpLibrary? code, includes c++/c/fortran bindings
  2. minor modifications to makefiles to accommodate new code
  3. updated README in src to tell how to compile code in src and test
File size: 5.9 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
3PY_SRC_HEADERS  = /opt/rappture/include/python2.4
4
5# tell make where to find the python shared library
6EMB_PY_LIB_FLAG = -lpython2.4
7EMB_PY_LIB_DIR  = /opt/rappture/lib
8
9EMB_PY_FLAGS    = -Wl,-rpath,$(EMB_PY_LIB_DIR) -L$(EMB_PY_LIB_DIR) $(EMB_PY_LIB_FLAG)
10
11
12# tell make where to find the libscew sources
13SCEW_HEADERS    = /opt/rappture/include/scew
14LIB_SCEW_INCL   = -I $(SCEW_HEADERS)
15LIB_SCEW_FLAG   = -L/opt/rappture/lib -lscew
16#LIB_SCEW_FLAG  = -static -L/opt/rappture/lib -lscew
17
18
19# everything below should be ok, but check to make sure
20# especially check the fortran flags, if youre using fortran
21#
22# define the top of our directory structure
23# replace this with the full path of the directory
24# containing the rappture directory
25TOP_DIR         = ../..
26
27# define the top of the rappture directory structure
28RP_BASE   = $(TOP_DIR)/rappture
29
30# define which programs can be made
31PROGS                   =       librappture                             \
32                                        libRpObjects                    \
33                                        librappture_test
34
35# define our compiling environment
36#
37CC                              = gcc
38CXX                             = g++
39DEBUG                   = -g -Wall
40DEBUG_PLUS              = -g -DDEBUG
41
42# FORTRAN BINDINGS COMPILER FLAGS
43#
44# available flags
45#
46#       COMPNAME_NOCHANGE               -       No change to the Rappture Library function
47#                                                               name
48#       COMPNAME_UPPERCASE      -       Replace the Rappture Library function name
49#                                                               with an all uppercase version of the name
50#       COMPNAME_ADD1UNDERSCORE -       add 1 underscore to the end of the Rappture
51#                                                               Library function name
52#       COMPNAME_ADD2UNDERSCORE -       add 2 underscores to the end of the Rappture
53#                                                               Library function name
54#
55# when setting CFLAGS, use the following guide for help
56#
57# gnu's g77/f77                 COMPNAME_ADD2UNDERSCORE
58# absoft's f77                  COMPNAME_ADD1UNDERSCORE
59# intel's ifort                 COMPNAME_ADD1UNDERSCORE
60# intel's mpif90                COMPNAME_ADD1UNDERSCORE
61#
62#
63
64CFLAGS                  = -DCOMPNAME_ADD2UNDERSCORE
65
66F77                     = g77
67#F77                            = f77
68#F77                            = ifort
69#F77                            = /opt/mpich-1.2.6/p4-intel/bin/mpif90
70
71LN              = ln
72
73# define our directories
74#
75INCLUDES_DIR    = $(RP_BASE)/include
76BIN_DIR                 = $(RP_BASE)/bin
77LIB_DIR                 = $(RP_BASE)/src
78SRC_DIR                 = $(RP_BASE)/src
79TEST_DIR                = $(RP_BASE)/test
80
81CORE_SRC                = $(SRC_DIR)/core
82FORT_SRC                = $(SRC_DIR)/fortran
83CEE_SRC                 = $(SRC_DIR)/cee
84PY_SRC                  = $(SRC_DIR)/python
85
86LIB_INC_PREFIX  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR)
87LIB_RP_OBJECTS  = $(LIB_INC_PREFIX) -lRpObjects
88LIB_RAPPTURE    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture
89LIB_RAPPTURE_T  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture_test
90
91INCL_CORE               = -I $(INCLUDES_DIR)/core
92INCL_CEE                = -I $(INCLUDES_DIR)/cee -I $(PY_SRC_HEADERS)
93INCL_FORTRAN    = -I $(INCLUDES_DIR)/fortran
94INCL_PY                 = -I $(INCLUDES_DIR)/python
95
96
97# default:
98
99all: ${PROGS}
100
101RP_IO_DEPS              = RpLibrary.o RpLibraryCInterface.o RpLibraryFInterface.o scew_extras.o
102RP_UNITS_DEPS   =  RpUnitsStd.o RpUnits.o RpUnitsCInterface.o RpUnitsFInterface.o
103RP_OTHER_DEPS   = RpFortranCommon.o
104
105# include rappture library definitions
106
107#### librappture shared object ###########################################
108
109librappture: rappture_fortran.o rappture_interface.o RpUnitsCInterface.o RpUnitsFInterface.o RpFortranCommon.o RpUnitsStd.o RpUnits.o
110        $(CXX) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
111                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ $(EMB_PY_FLAGS)
112
113        /sbin/ldconfig -n $(LIB_DIR)
114
115librappture_test: $(RP_IO_DEPS) $(RP_UNITS_DEPS) $(RP_OTHER_DEPS)
116        $(CXX) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
117                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ $(LIB_SCEW_FLAG)
118
119        /sbin/ldconfig -n $(LIB_DIR)
120
121#### libRpObjects ########################################################
122libRpObjects: RpVariable.o RpAbout.o RpNumber.o RpString.o RpBoolean.o RpChoice.o RpOption.o RpUnitsStd.o RpUnits.o
123        $(CXX) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
124                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^
125       
126        /sbin/ldconfig -n $(LIB_DIR)
127
128
129# include core source files
130
131RpLibrary.o: $(CORE_SRC)/RpLibrary.cc
132        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(LIB_SCEW_INCL) -o $@ -c $?
133
134scew_extras.o: $(CORE_SRC)/scew_extras.c
135        $(CC) -fPIC $(DEBUG) $(INCL_CORE) $(LIB_SCEW_INCL) -o $@ -c $?
136
137RpVariable.o: $(CORE_SRC)/RpVariable.cc
138        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
139
140RpAbout.o: $(CORE_SRC)/RpAbout.cc
141        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
142
143RpNumber.o: $(CORE_SRC)/RpNumber.cc
144        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
145
146RpString.o: $(CORE_SRC)/RpString.cc
147        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
148
149RpBoolean.o: $(CORE_SRC)/RpBoolean.cc
150        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
151
152RpChoice.o: $(CORE_SRC)/RpChoice.cc
153        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
154
155RpOption.o: $(CORE_SRC)/RpOption.cc
156        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
157
158RpUnitsStd.o: $(CORE_SRC)/RpUnitsStd.cc
159        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
160
161RpUnits.o: $(CORE_SRC)/RpUnits.cc
162        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
163
164
165
166
167# include cee binding definitions
168
169rappture_interface.o: $(CEE_SRC)/rappture_interface.c
170        $(CXX) -fPIC $(DEBUG) $(INCL_CEE) $(INCL_PY) -o $@ -c $<
171
172RpUnitsCInterface.o: $(CEE_SRC)/RpUnitsCInterface.cc
173        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) -o $@ -c $?
174
175RpLibraryCInterface.o: $(CEE_SRC)/RpLibraryCInterface.cc
176        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) $(LIB_SCEW_INCL) -o $@ -c $?
177
178
179
180
181# include fortran binding definitions
182
183rappture_fortran.o: $(FORT_SRC)/rappture_fortran.c
184        $(CXX) $(CFLAGS) -fPIC $(DEBUG) $(INCL_FORTRAN) $(INCL_CORE) $(INCL_CEE) $(INCL_PY) -o $@ -c $<
185
186RpUnitsFInterface.o: $(FORT_SRC)/RpUnitsFInterface.cc
187        $(CXX) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_FORTRAN) -o $@ -c $?
188
189RpFortranCommon.o: $(FORT_SRC)/RpFortranCommon.c
190        $(CXX) $(CFLAGS) -fPIC $(DEBUG) $(INCL_FORTRAN) -o $@ -c $<
191
192RpLibraryFInterface.o: $(FORT_SRC)/RpLibraryFInterface.cc
193        $(CXX) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_FORTRAN) $(LIB_SCEW_INCL) -o $@ -c $?
194
195
196
197
198#### CLEAN UP ############################################################
199clean:
200        - rm -f *.o librappture*.so* libRp*.so*
Note: See TracBrowser for help on using the repository browser.