source: trunk/src/Makefile @ 76

Last change on this file since 76 was 76, checked in by dkearney, 15 years ago
  1. cleaned up make files some more, deleted make.inc files
  2. updated RpUnits module and Cee and Fortran interfaces
  3. changed return values for some fortran interfaces,

error messages not working yet

  1. still need to add copy assignment code to RpUnits
File size: 4.7 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# 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
17TOP_DIR         = ../..
18
19# define the top of the rappture directory structure
20RP_BASE   = $(TOP_DIR)/rappture
21
22# define which programs can be made
23PROGS                   =       librappture                             \
24                                        libRpObjects                    \
25
26# define our compiling environment
27#
28CC                              = gcc
29CXX                             = g++
30DEBUG                   = -g -Wall
31DEBUG_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
55CFLAGS                  = -DCOMPNAME_ADD2UNDERSCORE
56
57F77                     = g77
58#F77                            = f77
59#F77                            = ifort
60#F77                            = /opt/mpich-1.2.6/p4-intel/bin/mpif90
61
62LN              = ln
63
64# define our directories
65#
66INCLUDES_DIR    = $(RP_BASE)/include
67BIN_DIR                 = $(RP_BASE)/bin
68LIB_DIR                 = $(RP_BASE)/src
69SRC_DIR                 = $(RP_BASE)/src
70TEST_DIR                = $(RP_BASE)/test
71
72CORE_SRC                = $(SRC_DIR)/core
73FORT_SRC                = $(SRC_DIR)/fortran
74CEE_SRC                 = $(SRC_DIR)/cee
75PY_SRC                  = $(SRC_DIR)/python
76
77LIB_INC_PREFIX  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR)
78LIB_RP_OBJECTS  = $(LIB_INC_PREFIX) -lRpObjects
79LIB_RAPPTURE    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture
80
81INCL_CORE               = -I $(INCLUDES_DIR)/core
82INCL_CEE                = -I $(INCLUDES_DIR)/cee -I $(PY_SRC_HEADERS)
83INCL_FORTRAN    = -I $(INCLUDES_DIR)/fortran
84INCL_PY                 = -I $(INCLUDES_DIR)/python
85
86
87# default:
88
89all: ${PROGS}
90
91# include rappture library definitions
92
93#### librappture shared object ###########################################
94
95librappture: 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 ########################################################
103libRpObjects: 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
112RpVariable.o: $(CORE_SRC)/RpVariable.cc
113        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
114
115RpAbout.o: $(CORE_SRC)/RpAbout.cc
116        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
117
118RpNumber.o: $(CORE_SRC)/RpNumber.cc
119        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
120
121RpString.o: $(CORE_SRC)/RpString.cc
122        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
123
124RpBoolean.o: $(CORE_SRC)/RpBoolean.cc
125        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
126
127RpChoice.o: $(CORE_SRC)/RpChoice.cc
128        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
129
130RpOption.o: $(CORE_SRC)/RpOption.cc
131        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
132
133RpUnitsStd.o: $(CORE_SRC)/RpUnitsStd.cc
134        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
135
136RpUnits.o: $(CORE_SRC)/RpUnits.cc
137        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
138
139
140
141
142# include cee binding definitions
143
144rappture_interface.o: $(CEE_SRC)/rappture_interface.c
145        $(CXX) -fPIC $(DEBUG) $(INCL_CEE) $(INCL_PY) -o $@ -c $<
146
147RpUnitsCInterface.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
155rappture_fortran.o: $(FORT_SRC)/rappture_fortran.c
156        $(CXX) $(CFLAGS) -fPIC $(DEBUG) $(INCL_FORTRAN) $(INCL_CORE) $(INCL_CEE) $(INCL_PY) -o $@ -c $<
157
158RpUnitsFInterface.o: $(FORT_SRC)/RpUnitsFInterface.cc
159        $(CXX) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_FORTRAN) -o $@ -c $?
160
161RpFortranCommon.o: $(FORT_SRC)/RpFortranCommon.c
162        $(CC) $(CFLAGS) -fPIC $(DEBUG) $(INCL_FORTRAN) -o $@ -c $<
163
164
165
166
167#### CLEAN UP ############################################################
168clean:
169        - rm -f $(BIN_DIR)/* *.o librappture.* libR*.so*
Note: See TracBrowser for help on using the repository browser.