source: trunk/src/Makefile @ 85

Last change on this file since 85 was 85, checked in by cxsong, 19 years ago

adding good makefile

File size: 5.3 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
3RP_INSTALL_BASE = /opt/rappture
4
5# tell make where to find the libscew sources
6EXPAT_HEADERS   = /opt/rappture/include
7LIB_EXPAT_INCL  = -I $(EXPAT_HEADERS)
8SCEW_HEADERS    = /opt/rappture/include/scew
9LIB_SCEW_INCL   = -I $(SCEW_HEADERS) -I $(EXPAT_HEADERS)
10LIB_SCEW_FLAG   = -L/opt/rappture/lib -lscew
11#LIB_SCEW_FLAG   = /opt/rappture/lib/libscew.a
12#LIB_SCEW_FLAG   = -static -L/opt/rappture/lib -lscew
13
14
15# everything below should be ok, but check to make sure
16#
17# define the top of our directory structure
18# replace this with the full path of the directory
19# containing the rappture directory
20TOP_DIR         = ../..
21
22# define the top of the rappture directory structure
23RP_BASE   = $(TOP_DIR)/svn.rappture
24
25# define which programs can be made
26PROGS           =   librappture   \
27                    libRpObjects  \
28                    Rappture.Units
29
30# define our compiling environment
31#
32CC              = gcc
33CXX             = g++
34DEBUG           = -g -Wall
35DEBUG_PLUS      = -g -DDEBUG
36PY              = python
37
38LN              = ln
39
40# define our directories
41#
42INCLUDES_DIR    = $(RP_BASE)/include
43BIN_DIR         = $(RP_BASE)/bin
44LIB_DIR         = $(RP_BASE)/src
45SRC_DIR         = $(RP_BASE)/src
46TEST_DIR        = $(RP_BASE)/test
47
48CORE_SRC        = $(SRC_DIR)/core
49FORT_SRC        = $(SRC_DIR)/fortran
50CEE_SRC         = $(SRC_DIR)/cee
51PY_SRC          = $(SRC_DIR)/python
52
53LIB_INC_PREFIX  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR)
54LIB_RP_OBJECTS  = $(LIB_INC_PREFIX) -lRpObjects
55LIB_RAPPTURE    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture
56
57INCL_CORE       = -I $(INCLUDES_DIR)/core
58INCL_CEE        = -I $(INCLUDES_DIR)/cee
59INCL_FORTRAN    = -I $(INCLUDES_DIR)/fortran
60INCL_PY         = -I $(INCLUDES_DIR)/python
61
62
63# default:
64
65all: ${PROGS}
66install: all install_py install_rappture install_rpobjs
67
68RP_IO_DEPS      = RpLibrary.o RpLibraryCInterface.o RpLibraryFInterface.o \
69                  scew_extras.o
70RP_UNITS_DEPS   = RpUnitsStd.o RpUnits.o RpUnitsCInterface.o RpUnitsFInterface.o
71RP_OTHER_DEPS   = RpFortranCommon.o
72RP_OBJS_DEP     = RpVariable.o RpAbout.o RpNumber.o RpString.o RpBoolean.o \
73                  RpChoice.o RpOption.o RpUnitsStd.o RpUnits.o
74
75# include rappture library definitions
76
77#### librappture shared object ###########################################
78
79librappture: $(RP_IO_DEPS) $(RP_UNITS_DEPS) $(RP_OTHER_DEPS)
80        $(CXX) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
81                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ $(LIB_SCEW_FLAG)
82
83        /sbin/ldconfig -n $(LIB_DIR)
84
85install_rappture: librappture
86        cp -d $<.so* $(RP_INSTALL_BASE)/lib
87
88#### libRpObjects ########################################################
89libRpObjects: $(RP_OBJS_DEP)
90        $(CC) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
91                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ -lstdc++
92#       $(CXX) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
93#               -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^
94       
95        /sbin/ldconfig -n $(LIB_DIR)
96
97install_rpobjs: libRpObjects
98        cp -d $<.so* $(RP_INSTALL_BASE)/lib
99
100#### Python ########################################################
101Rappture.Units: RpUnits.o RpUnitsStd.o
102        $(PY) $(PY_SRC)/setup.py build
103
104install_py: RpUnits.o RpUnitsStd.o
105        $(PY) $(PY_SRC)/setup.py install
106
107
108
109# include core source files
110
111RpLibrary.o: $(CORE_SRC)/RpLibrary.cc
112        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(LIB_SCEW_INCL) -o $@ -c $?
113
114scew_extras.o: $(CORE_SRC)/scew_extras.c
115        $(CC) -fPIC $(DEBUG) $(INCL_CORE) $(LIB_SCEW_INCL) -o $@ -c $?
116
117RpVariable.o: $(CORE_SRC)/RpVariable.cc
118        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
119
120RpAbout.o: $(CORE_SRC)/RpAbout.cc
121        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
122
123RpNumber.o: $(CORE_SRC)/RpNumber.cc
124        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
125
126RpString.o: $(CORE_SRC)/RpString.cc
127        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
128
129RpBoolean.o: $(CORE_SRC)/RpBoolean.cc
130        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
131
132RpChoice.o: $(CORE_SRC)/RpChoice.cc
133        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
134
135RpOption.o: $(CORE_SRC)/RpOption.cc
136        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
137
138RpUnitsStd.o: $(CORE_SRC)/RpUnitsStd.cc
139        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
140
141RpUnits.o: $(CORE_SRC)/RpUnits.cc
142        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
143
144
145
146
147# include cee binding definitions
148
149rappture_interface.o: $(CEE_SRC)/rappture_interface.c
150        $(CXX) -fPIC $(DEBUG) $(INCL_CEE) $(INCL_PY) -o $@ -c $<
151
152RpUnitsCInterface.o: $(CEE_SRC)/RpUnitsCInterface.cc
153        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) -o $@ -c $?
154
155RpLibraryCInterface.o: $(CEE_SRC)/RpLibraryCInterface.cc
156        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) $(LIB_SCEW_INCL) -o $@ -c $?
157
158
159
160
161# include fortran binding definitions
162
163rappture_fortran.o: $(FORT_SRC)/rappture_fortran.c
164        $(CXX) -fPIC $(DEBUG) $(INCL_FORTRAN) $(INCL_CORE) $(INCL_CEE) $(INCL_PY) -o $@ -c $<
165
166RpUnitsFInterface.o: $(FORT_SRC)/RpUnitsFInterface.cc
167        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_FORTRAN) -o $@ -c $?
168
169RpFortranCommon.o: $(FORT_SRC)/RpFortranCommon.c
170        $(CXX) -fPIC $(DEBUG) $(INCL_FORTRAN) -o $@ -c $<
171
172RpLibraryFInterface.o: $(FORT_SRC)/RpLibraryFInterface.cc
173        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_FORTRAN) $(LIB_SCEW_INCL) -o $@ -c $?
174
175
176
177
178#### CLEAN UP ############################################################
179clean:
180        - rm -f *.o librappture.so* libRp*.so*
181        - rm -rf build
Note: See TracBrowser for help on using the repository browser.