source: trunk/src/Makefile @ 84

Last change on this file since 84 was 84, checked in by dkearney, 17 years ago
  1. added "install" target to make file for copying files over to /opt/rappture
  2. added targets for python to build and install the units module
  3. added fortran stub functions for library and units.

RpLibraryF_test.f compiles, just with warnings, because i'm still working on it.

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