-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.in
321 lines (283 loc) · 9.8 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
##
## File: Makefile.in
## Package: SAMRAI
## Copyright: (c) 1997-2008 Lawrence Livermore National Security, LLC
## Revision: $LastChangedRevision: 2219 $
## Modified: $LastChangedDate: 2008-06-12 13:14:48 -0700 (Thu, 12 Jun 2008) $
## Description: makefile for the entire SAMRAI distribution
##
default: library
SUBDIR = .
SRCDIR = @srcdir@
OBJECT = .
include ./config/Makefile.config
INCLUDE_SAM = @top_srcdir@/include
INSTALL = sh @srcdir@/config/install-sh
INSTDIR = @INSTDIR@
#
# List of packages to process.
# tbox is not included since all of it's object files go into libSAMRAI.a (.so)
#
PACKAGES=appu algs solv geom mesh math pdat xfer hier
PACKAGES_R=hier xfer pdat math mesh geom solv algs appu
#
# List of PACKAGES that should be split into std and special libraries.
#
SPECIAL_PACKAGES=pdat math
#
# List of libraries that will be created.
# tbox is not included since all of it's object files go into libSAMRAI.a (.so)
#
LIBRARIES=appu algs solv geom mesh math_special math_std pdat_special pdat_std xfer hier
LIBRARIES_R=hier xfer pdat_std pdat_special math_std math_special mesh geom solv algs appu
#
# Patterns used to determine files to be put into the special libraries.
# Non-matching will into std library.
#
# SGS can these be removed?
# Last two entries force two fortran objects into special in order to make
# sure it always has something in it and to get the ordering
# correct for linking.
SPECIAL="(bool|char|float|complex|timeintopts|lintimint|dbugfort)"
# Package to directory name mapping
dir_appu=apputils
export dir_appu
dir_algs=algorithm
export dir_algs
dir_solv=solvers
export dir_solv
dir_geom=geometry
export dir_geom
dir_mesh=mesh
export dir_mesh
dir_math=mathops
export dir_math
dir_pdat=patchdata
export dir_pdat
dir_xfer=transfer
export dir_xfer
dir_hier=hierarchy
export dir_hier
dir_tbox=toolbox
export dir_tbox
# These targets are based on the current config chosen (standard, noxargs,
# or shared).
library:
$(MAKE) NDIM=1 compile || exit 1
$(MAKE) NDIM=2 compile || exit 1
$(MAKE) NDIM=3 compile || exit 1
$(MAKE) archive_lib_$(SAMRAI_TARGET) || exit 1
$(MAKE) NDIM=1 archive_libXd_$(SAMRAI_TARGET) || exit 1
$(MAKE) NDIM=2 archive_libXd_$(SAMRAI_TARGET) || exit 1
$(MAKE) NDIM=3 archive_libXd_$(SAMRAI_TARGET) || exit 1
lib1d:
$(MAKE) NDIM=1 compile || exit 1
$(MAKE) archive_lib_$(SAMRAI_TARGET) || exit 1
$(MAKE) NDIM=1 archive_libXd_$(SAMRAI_TARGET) || exit 1
lib2d:
$(MAKE) NDIM=2 compile || exit 1
$(MAKE) archive_lib_$(SAMRAI_TARGET) || exit 1
$(MAKE) NDIM=2 archive_libXd_$(SAMRAI_TARGET) || exit 1
lib3d:
$(MAKE) NDIM=3 compile || exit 1
$(MAKE) archive_lib_$(SAMRAI_TARGET) || exit 1
$(MAKE) NDIM=3 archive_libXd_$(SAMRAI_TARGET) || exit 1
libXd: Makefile
$(MAKE) compile || exit 1
$(MAKE) archive_lib_$(SAMRAI_TARGET) || exit 1
$(MAKE) archive_libXd_$(SAMRAI_TARGET) || exit 1
tools: forcetools
@if test ! -d bin; then mkdir bin; fi
(cd tools && $(MAKE) $@) || exit 1
# Since directory tools exists create a target that is not directory
# so tools will evaluate
forcetools:
clean:
( cd source && $(MAKE) $@ ) || exit 1
( cd tools && $(MAKE) $@ ) || exit 1
( cd source/test && $(MAKE) $@ ) || exit 1
$(RM) lib/libSAMRAI*.a
$(RM) lib/libSAMRAI*.so
$(RM) bin/*
#
# Compile the source for DIM=NDIM
#
compile:
(cd source && $(MAKE) libXd) || exit 1
# Build temporary files containing list of object files for each
# library.
archive_gather_obj_names: archive_remove_obj_names
@find source -name "*.o" -print | egrep -v "(test)" > obj.all
@grep "$(NDIM).o" obj.all > obj.$(NDIM)d
@cp obj.$(NDIM)d obj.$(NDIM)d.remain
@-for i in $(PACKAGES); \
do \
eval dir=\$${dir_$$i}; \
grep $$dir obj.$(NDIM)d.remain >> obj.$(NDIM)d.$$i; \
grep -v $$dir obj.$(NDIM)d.remain > obj.$(NDIM)d.tmp; \
mv obj.$(NDIM)d.tmp obj.$(NDIM)d.remain; \
done
@mv obj.$(NDIM)d.remain obj.$(NDIM)d.shouldbeempty
@-for i in $(SPECIAL_PACKAGES); \
do \
egrep -i ${SPECIAL} obj.$(NDIM)d.$$i > obj.$(NDIM)d.$$i\_special; \
egrep -i -v ${SPECIAL} obj.$(NDIM)d.$$i > obj.$(NDIM)d.$$i\_std; \
$(RM) obj.$(NDIM)d.$$i; \
done
# Remove temporary lists of object files
archive_remove_obj_names:
@for i in $(LIBRARIES); \
do \
$(RM) obj.$(NDIM)d.$$i; \
done
@$(RM) obj.$(NDIM)d obj.$(NDIM)d.all obj.all obj.$(NDIM)d.shouldbeempty
#=============================================================================
#
# Static library with xargs targets
#
#=============================================================================
archive_lib_standard:
@if test ! -d lib; then mkdir lib; fi
@find source -name "*.o" -print | egrep -v "(test)" > obj.nd.all
@grep -v "[0-9].o" obj.nd.all > obj.nd.tmp
@grep -v "[0-9]\-" obj.nd.tmp > obj.nd.other
@echo "Creating archive lib/libSAMRAI$(LIB_SUFFIX)"
@$(RM) lib/libSAMRAI$(LIB_SUFFIX)
@cat obj.nd.other | @XARGS@ @AR@ ru lib/libSAMRAI$(LIB_SUFFIX)
@$(RM) obj.nd.tmp
@$(RM) obj.nd.other
@$(RM) obj.nd.all
archive_libXd_standard:
$(MAKE) archive_gather_obj_names
@for i in $(LIBRARIES); \
do \
echo "Creating archive lib/libSAMRAI$(NDIM)d_$$i$(LIB_SUFFIX)"; \
$(RM) lib/libSAMRAI$(NDIM)d_$$i$(LIB_SUFFIX); \
cat obj.$(NDIM)d.$$i | @XARGS@ @AR@ ru lib/libSAMRAI$(NDIM)d_$$i$(LIB_SUFFIX); \
done
$(MAKE) archive_remove_obj_names
#=============================================================================
#
# Static library without xargs targets
#
#=============================================================================
archive_lib_noxargs:
@if test ! -d lib; then mkdir lib; fi
@find source -name "*.o" -print | egrep -v "(test)" > obj.nd.all
@grep -v "[0-9].o" obj.nd.all > obj.nd.tmp
@grep -v "[0-9]\-" obj.nd.tmp > obj.nd.other
@$(RM) lib/libSAMRAI$(LIB_SUFFIX)
@@AR@ ru lib/libSAMRAI$(LIB_SUFFIX) `cat obj.nd.other`
@$(RM) obj.nd.tmp
@$(RM) obj.nd.other
@$(RM) obj.nd.all
archive_libXd_noxargs:
$(MAKE) archive_gather_obj_names
@for i in $(LIBRARIES); \
do \
echo "Creating archive lib/libSAMRAI$(NDIM)d_$$i$(LIB_SUFFIX)"; \
$(RM) lib/libSAMRAI$(NDIM)d_$$i$(LIB_SUFFIX); \
@AR@ ru lib/libSAMRAI$(NDIM)d_$$i$(LIB_SUFFIX) `cat obj.$(NDIM)d.$$i`; \
done
$(MAKE) archive_remove_obj_names
#=============================================================================
#
# Shared library targets
#
#=============================================================================
archive_lib_shared:
@if test ! -d lib; then mkdir lib; fi
@find source -name "*.o" -print | egrep -v "(test)" > obj.nd.all
@grep -v "[0-9].o" obj.nd.all > obj.nd.tmp
@grep -v "[0-9]\-" obj.nd.tmp > obj.nd.other
@$(RM) lib/libSAMRAI$(LIB_SUFFIX)
$(CXX) $(CXXLD_FLAGS) -o lib/libSAMRAI$(LIB_SUFFIX) `cat obj.nd.other` $(CXXLDLIBS)
@$(RM) obj.nd.tmp
@$(RM) obj.nd.other
@$(RM) obj.nd.all
archive_libXd_shared:
$(MAKE) archive_gather_obj_names
@LIBLIST="-lSAMRAI"; \
for i in $(LIBRARIES_R); \
do \
echo "Creating archive lib/libSAMRAI$(NDIM)d_$$i$(LIB_SUFFIX)"; \
$(RM) lib/libSAMRAI$(NDIM)d_$$i$(LIB_SUFFIX); \
$(CXX) $(CXXLD_FLAGS) -o lib/libSAMRAI$(NDIM)d_$$i$(LIB_SUFFIX) `cat obj.$(NDIM)d.$$i` -L./lib $$LIBLIST $(CXXLDLIBS); \
LIBLIST="$$LIBLIST -lSAMRAI$(NDIM)d_$$i"; \
done
$(MAKE) archive_remove_obj_names
install:
$(INSTALL) -d -m 755 $(INSTDIR)/config
$(INSTALL) -d -m 755 $(INSTDIR)/lib
$(INSTALL) -d -m 755 $(INSTDIR)/bin
$(INSTALL) -d -m 755 $(INSTDIR)/include
$(INSTALL) -d -m 755 $(INSTDIR)/include/tbox
$(INSTALL) -c -m 644 COPYRIGHT $(INSTDIR)
$(INSTALL) -c -m 644 config.status $(INSTDIR)/config
$(INSTALL) -c -m 644 config/Makefile.config $(INSTDIR)/config
cat config/Makefile.config.install >> $(INSTDIR)/config/Makefile.config
for i in include/*.h; do \
$(INSTALL) -c -m 644 $$i $(INSTDIR)/include; \
done
for i in $(INCLUDE_SAM)/*.h; do \
$(INSTALL) -c -m 644 $$i $(INSTDIR)/include; \
done
for i in $(INCLUDE_SAM)/*.I; do \
$(INSTALL) -c -m 644 $$i $(INSTDIR)/include; \
done
for i in $(INCLUDE_SAM)/*.C; do \
$(INSTALL) -c -m 644 $$i $(INSTDIR)/include; \
done
for i in $(INCLUDE_SAM)/*.i; do \
$(INSTALL) -c -m 644 $$i $(INSTDIR)/include; \
done
for i in $(INCLUDE_SAM)/tbox/*.h; do \
$(INSTALL) -c -m 644 $$i $(INSTDIR)/include/tbox; \
done
for i in $(INCLUDE_SAM)/tbox/*.I; do \
$(INSTALL) -c -m 644 $$i $(INSTDIR)/include/tbox; \
done
for i in $(INCLUDE_SAM)/tbox/*.C; do \
$(INSTALL) -c -m 644 $$i $(INSTDIR)/include/tbox; \
done
if test -f lib/libSAMRAI.a; then \
for i in lib/libSAMRAI*.a; do \
$(INSTALL) -c -m 644 $$i $(INSTDIR)/lib; \
done \
fi
if test -f lib/libSAMRAI.so; then \
for i in lib/libSAMRAI*.so; do \
$(INSTALL) -c -m 644 $$i $(INSTDIR)/lib; \
done \
fi
if test -f bin/restart-redistribute; then \
for i in bin/*; do \
$(INSTALL) -c -m 755 $$i $(INSTDIR)/bin; \
done \
fi
# Rebuild config.status if configure changed.
config.status: @top_srcdir@/configure
./config.status --recheck
# Rules for making documentation from top level.
dox redox devdox redevdox:
(cd docs && $(MAKE) $@)
# Run the SAMRAI test suite
check:
(cd source/test; $(MAKE) check)
# Run the SAMRAI test suite as it is run in autotests
checktest:
(cd source/test; $(MAKE) checktest)
# Update copies/links in the include directory
# Only needed if you modifiy SAMRAI files, normal
# users don't need to do this.
update:
(cd @top_srcdir@ && ./source/scripts/update)
# Generate the automatically created files.
# Only needed if you modifiy SAMRAI files, normal
# users don't need to do this.
genfiles: update
@-(cd @top_srcdir@; \
for i in `find . -name genfiles.sh`; \
do \
(cd `dirname $$i` && ./genfiles.sh) \
done)