source: trunk/src/Makefile.in @ 942

Last change on this file since 942 was 942, checked in by gah, 15 years ago

Makefile fixups

File size: 7.3 KB
Line 
1
2bindir          = @bindir@
3datadir         = @datarootdir@
4exec_prefix     = @exec_prefix@
5includedir      = @includedir@
6libdir          = @libdir@
7mandir          = @mandir@
8prefix          = @prefix@
9
10INSTALL         = @INSTALL@
11INSTALL_PROGRAM = ${INSTALL} -m 755
12INSTALL_DATA    = ${INSTALL} -m 644
13INSTALL_SCRIPT  = ${INSTALL}
14
15
16# tell make where to find the expat & libscew headers
17INCL_RP_DEPS    = -I$(includedir)
18
19EXTERNAL_RP_LIBS   = @LIB_SEARCH_DIRS@ -lexpat -lscew -lz -lb64 -lm
20
21
22# define the top of the rappture directory structure
23RP_BASE   = @RP_BASE@
24
25# define which programs can be made
26PROGS           =   librappture    \
27                    libRpObjects
28
29# define our compiling environment
30#
31CC              = @CC@
32CXX             = @CXX@
33DEBUG           = -g -Wall
34DEBUG_PLUS      = -g -DDEBUG
35LN              = ln
36CFLAGS = -fPIC
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
44SRC2_DIR        = $(RP_BASE)/src2
45TEST_DIR        = $(RP_BASE)/test
46
47CORE_SRC        = $(SRC_DIR)/core
48CORE2_SRC       = $(SRC2_DIR)/core
49FORT_SRC        = $(SRC_DIR)/fortran
50CEE_SRC         = $(SRC_DIR)/cee
51
52INCL_CORE       = -I$(CORE_SRC)
53INCL_CORE2      = -I$(CORE2_SRC)
54INCL_CEE        = -I$(CEE_SRC)
55INCL_FORTRAN    = -I$(FORT_SRC)
56INCL_MATLAB     = -I$(MATLAB_SRC)
57INCL_OCTAVE     = -I$(OCTAVE_SRC)
58
59# default:
60
61all: ${PROGS}
62install:        install_rappture \
63                        install_rpobjs
64
65RP_IO_DEPS      = RpLibrary.o RpLibraryCInterface.o RpLibraryFInterface.o \
66                  scew_extras.o RpEntityRef.o RpUtils.o
67RP_UNITS_DEPS   = RpUnitsStd.o RpUnits.o RpUnitsCInterface.o RpUnitsFInterface.o
68RP_UTILS_DEPS   = RpUtils.o RpUtilsCInterface.o RpUtilsFInterface.o
69RP_OTHER_DEPS   = RpFortranCommon.o RpBindingsDict.o \
70                  RpBufferCInterface.o RpOutcomeCInterface.o
71RP_OBJS_DEP     = RpVariable.o RpAbout.o RpNumber.o RpString.o RpBoolean.o \
72                  RpChoice.o RpOption.o RpUnitsStd.o RpUnits.o
73                  #RpValue.o RpValueDouble.o RpValueString.o
74RP2_OBJ_DEP     = $(CORE2_SRC)/Outcome.o $(CORE2_SRC)/Ptr.o $(CORE2_SRC)/RpBuffer.o $(CORE2_SRC)/RpEncode.o
75
76
77LDLIB_MACOSX = -dynamiclib -o $(LIB_DIR)/$@.dylib
78LDLIB_LINUX = -shared -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0
79
80# include rappture library definitions
81
82#### librappture shared object ###########################################
83
84librappture: $(RP_IO_DEPS) $(RP_UTILS_DEPS) $(RP_UNITS_DEPS) $(RP_OTHER_DEPS)
85        (cd ../src2/core/; make Outcome.o Ptr.o RpBuffer.o RpEncode.o)
86        $(INSTALL_DATA) $(CORE_SRC)/*.h $(INCLUDES_DIR)
87        $(INSTALL_DATA) $(CEE_SRC)/*.h $(INCLUDES_DIR)
88        $(INSTALL_DATA) $(FORT_SRC)/*.h $(INCLUDES_DIR)
89        $(INSTALL_DATA) $(CORE2_SRC)/Outcome.h $(INCLUDES_DIR)
90        $(INSTALL_DATA) $(CORE2_SRC)/Ptr.h $(INCLUDES_DIR)
91        $(INSTALL_DATA) $(CORE2_SRC)/RpBuffer.h $(INCLUDES_DIR)
92        $(INSTALL_DATA) $(CORE2_SRC)/RpEncode.h $(INCLUDES_DIR)
93        $(INSTALL_DATA) $(CORE2_SRC)/rappture2.h $(INCLUDES_DIR)
94        @if test "`uname`" == "Darwin"; then \
95                $(CXX) $(DEGUG) $(LDLIB_MACOSX) $^ $(RP2_OBJ_DEP) $(EXTERNAL_RP_LIBS); \
96                ar -r $@.a $^ $(RP2_OBJ_DEP); \
97                ranlib -s $@.a; \
98        else \
99                $(CXX) $(DEGUG) $(LDLIB_LINUX) $^ $(RP2_OBJ_DEP) $(EXTERNAL_RP_LIBS); \
100                /sbin/ldconfig -n $(LIB_DIR); \
101                ar -r $@.a $^ $(RP2_OBJ_DEP); \
102                ranlib $@.a; \
103        fi
104
105install_rappture: librappture
106        @if test "`uname`" == "Darwin"; then \
107                cp $<.dylib $(libdir); \
108                cp $<.a $(libdir); \
109        else \
110                cp -d $<.so* $(libdir); \
111                cp -d $<.a $(libdir); \
112        fi
113        $(INSTALL_DATA) $(INCLUDES_DIR)/* $(includedir)
114
115#### libRpObjects ########################################################
116libRpObjects: $(RP_OBJS_DEP)
117        @if test "`uname`" == "Darwin"; then \
118                $(CXX) $(DEGUG) $(LDLIB_MACOSX) $^ -lstdc++; \
119        else \
120                $(CXX) $(DEGUG) $(LDLIB_LINUX) $^ -lstdc++; \
121                /sbin/ldconfig -n $(LIB_DIR); \
122        fi
123
124install_rpobjs: libRpObjects
125        @if test "`uname`" == "Darwin"; then \
126                cp $<.dylib $(libdir); \
127        else \
128                cp -d $<.so* $(libdir); \
129        fi
130
131####################################################################
132
133# include core source files
134
135RpLibrary.o: $(CORE_SRC)/RpLibrary.cc
136        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_CORE2) $(INCL_RP_DEPS)
137
138scew_extras.o: $(CORE_SRC)/scew_extras.c
139        $(CC) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_RP_DEPS)
140
141RpEntityRef.o: $(CORE_SRC)/RpEntityRef.cc
142        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_CORE2)
143
144RpUtils.o: $(CORE_SRC)/RpUtils.cc
145        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
146
147RpUnitsStd.o: $(CORE_SRC)/RpUnitsStd.cc
148        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
149
150RpUnits.o: $(CORE_SRC)/RpUnits.cc
151        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
152
153RpBindingsDict.o: $(CORE_SRC)/RpBindingsDict.cc
154        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
155
156
157# objects for rappture 2 developement
158
159RpVariable.o: $(CORE_SRC)/RpVariable.cc
160        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
161
162RpAbout.o: $(CORE_SRC)/RpAbout.cc
163        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
164
165RpNumber.o: $(CORE_SRC)/RpNumber.cc
166        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
167
168RpString.o: $(CORE_SRC)/RpString.cc
169        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
170
171RpBoolean.o: $(CORE_SRC)/RpBoolean.cc
172        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
173
174RpChoice.o: $(CORE_SRC)/RpChoice.cc
175        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
176
177RpOption.o: $(CORE_SRC)/RpOption.cc
178        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
179
180RpValue.o: $(CORE_SRC)/RpValue.cc
181        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
182
183RpValueDouble.o: $(CORE_SRC)/RpValueDouble.cc
184        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
185
186RpValueString.o: $(CORE_SRC)/RpValueString.cc
187        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE)
188
189
190# include cee binding definitions
191
192RpUtilsCInterface.o: $(CEE_SRC)/RpUtilsCInterface.cc
193        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_CEE)
194
195RpUnitsCInterface.o: $(CEE_SRC)/RpUnitsCInterface.cc
196        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_CEE)
197
198RpLibraryCInterface.o: $(CEE_SRC)/RpLibraryCInterface.cc $(CEE_SRC)/RpLibraryCInterface.h $(CEE_SRC)/RpBufferCInterface.h
199        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $< $(INCL_CORE) $(INCL_CORE2) $(INCL_CEE) $(INCL_RP_DEPS)
200
201RpBufferCInterface.o: $(CEE_SRC)/RpBufferCInterface.cc $(CEE_SRC)/RpBufferCInterface.h $(CEE_SRC)/RpOutcomeCInterface.h
202        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $< $(INCL_CORE) $(INCL_CORE2) $(INCL_CEE) $(INCL_RP_DEPS)
203
204RpOutcomeCInterface.o: $(CEE_SRC)/RpOutcomeCInterface.cc
205        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $< $(INCL_CORE) $(INCL_CORE2) $(INCL_CEE) $(INCL_RP_DEPS)
206
207
208
209# include fortran binding definitions
210
211RpUtilsFInterface.o: $(FORT_SRC)/RpUtilsFInterface.cc
212        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_FORTRAN)
213
214RpUnitsFInterface.o: $(FORT_SRC)/RpUnitsFInterface.cc
215        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_FORTRAN)
216
217RpFortranCommon.o: $(FORT_SRC)/RpFortranCommon.cc
218        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $< $(INCL_FORTRAN)
219
220RpLibraryFInterface.o: $(FORT_SRC)/RpLibraryFInterface.cc
221        $(CXX) $(CFLAGS) $(DEBUG) -o $@ -c $? $(INCL_CORE) $(INCL_CORE2) $(INCL_FORTRAN) $(INCL_RP_DEPS)
222
223
224docs:
225        if test ! -d docs; then \
226                mkdir docs; \
227        fi
228        if test ! -d docs/doxygen; then \
229                mkdir docs/doxygen; \
230        fi
231        doxygen
232
233#### CLEAN UP ############################################################
234clean:
235        - rm -f *.o librappture.* libRp*.so*
236        - rm -rf build
237
238distclean: clean
239        - rm Makefile
Note: See TracBrowser for help on using the repository browser.