File: Makefile.am

package info (click to toggle)
lam 6.5.6-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 15,464 kB
  • ctags: 11,670
  • sloc: ansic: 101,210; cpp: 12,146; sh: 10,821; makefile: 4,050; fortran: 218
file content (503 lines) | stat: -rw-r--r-- 16,564 bytes parent folder | download
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
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
# -*- makefile -*-
#
# $Id: Makefile.am,v 6.39.2.6 2001/10/11 00:31:35 jsquyres Exp $
#
# This file is part of the LAM/MPI software package from the
# University of Notre Dame.
#
# See the LICENSE file in the top-level directory for Copyright notices.
#

AUTOMAKE_OPTIONS	= foreign dist-tarZ no-dependencies

SUBDIRS			= share otb tools etc man
DIST_SUBDIRS		= $(SUBDIRS) examples config

EXTRA_DIST		= HISTORY INSTALL \
			  LICENSE README RELEASE_NOTES \
			  VERSION Makefile.depend

# 'cause this is just so annoying!!!  This may not work anywhere
# outside nd.edu.  :-)

TAR			= gtar

# This file is only here so that the "tags" target will work properly.
# Without *something* in either SOURCES or HEADERS, the tags target
# won't work nicely.  Ugh.  Hopefully this will be fixed in automake
# 1.5!

noinst_HEADERS		= acconfig.h

# For building all the examples

examples: lam-examples mpi2c++-examples romio-examples 
	@ $(MAKE) examples-done

examples-clean:
	@ echo "Making clean in examples"
	@ (cd examples; $(MAKE) clean)

examples-distclean:
	@ echo "Making distclean in examples"
	@ (cd examples; $(MAKE) distclean)

lam-examples:
	@ (cd examples; $(MAKE) all)

# Supplement various targets so that we can build ROMIO, MPI 2 C++
# bindings, and examples as well

all-local: $(MPI2CPP_BUILD_TARGET) $(ROMIO_BUILD_TARGET) 
	@ $(MAKE) all-done

install-exec-local: $(MPI2CPP_INSTALL_TARGET) $(ROMIO_INSTALL_TARGET)

clean-local: mpi2c++-clean romio-clean examples-clean
	@ rm -f .lam_built

distclean-local: mpi2c++-distclean romio-distclean examples-distclean

uninstall-local: mpi2c++-uninstall romio-uninstall

# Be sure to set LAMHOME properly so that hcc/hcp/hf77 use the right
# libraries/include files (to avoid conflicts if the user may already
# have a LAM installed, and already have LAMHOME set somewhere else).

# Before you ask, yes, the final "cat" on the ROMIO_TEMP line is
# necessary.  If it is not there and grep does not find '-g' in
# $(CFLAGS), grep will return 1, which will cause "make" to bail.  But
# apparently only the *last* command's return code will be returned to
# make.  Cat will always return 0, which means that "make" won't bail.
# Really weird.

# Another bug in ROMIO -- we have to go set the unix permissions on
# directories under $LAMHOME/include to be 755 again.  ROMIO does a
# chmod 644 $LAMHOME/include/* -- ick!  The ROMIO authors have been
# notified of this.  13 June 1999/JMS.

# Automakeizm -- check to see if we already built ROMIO.  "make
# install" implicitly invokes "make all" first (in a roundabout way).

# VPATHizms -- check to see if the "romio" dir exists.  If it doesn't,
# make it.  Then we have to go find the configure file.  If it's not
# in the romio dir, check ../$(top_srcdir)/romio.  If it's not there,
# barf.  Set LAM_TOP_BUILDDIR and LAM_TOP_SRCDIR as appropriate (hcc
# uses these variables to reset -I and -L paths).  Also, ROMIO doesn't
# seem to be able to create its "test" directory properly (if it
# doesn't exist), so we have to make it.

# libtoolizms -- set the underlying LAMHCC and LAMHF77 to have libtool
# in them.  Even though ROMIO will not create any executables, and
# therefore strictly won't need libtool, during ROMIO's configure, it
# checks for libmpi, etc., and makes some dummy executables, and
# therefore does need libtool.  Ugh!!

# Arrgh -- we have to forcibly remove -I$(top_srcdir)/share/include
# form $(CFLAGS) because relative to romio/, that directory doesn't
# exist, because $(top_srcdir) is replaced *here* -- not in romio/.
# Hence $(top_srcdir) is replaced with ., and ./share/include doesn't
# exist relative to romio.  $#%@#%@#%#$!!!  So we have to sed it out
# of $(CFLAGS) and put it in a temporary environment variable and use
# that instead.

romio-all:
	@ echo "Making all in romio"
	@ (if test ! -f romio/.lam_built; then $(MAKE) romio-all-redirect; fi)

romio-all-redirect:
	@ echo
	@ echo "Compiling ROMIO support"
	@ echo
	@ (LAM_TOP_BUILDDIR="`pwd`"; \
	 LAM_TOP_SRCDIR="$$LAM_TOP_BUILDDIR"; \
	 if test ! -d romio; then \
	   mkdir -p romio/test; \
	 fi ; \
	 cd romio ; \
	 LAMHCC="$$LAM_TOP_BUILDDIR/libtool --quiet $(CC)" ; \
	 LAMF77="$$LAM_TOP_BUILDDIR/libtool --quiet $(FC)" ; \
	 LAMHOME="$(DESTDIR)$(prefix)" ; \
	 ROMIO_DEBUG="" ; \
	 ROMIO_TEMP="`echo '$(CFLAGS)' | grep '\-g' | cat`" ; \
	 if test "$$ROMIO_TEMP" != ""; then \
		 ROMIO_DEBUG="-debug" ; \
	 fi ; \
	 TOP_SRCDIR_ESC="`echo '$(top_srcdir)' | sed -e 's/\//\\\\\//g'`"; \
	 CFLAGS_ENV="`echo '$(CFLAGS)' | sed -e s/-I$$TOP_SRCDIR_ESC\\\/share\\\/include// | cat`" ; \
	 TROLLIUSHOME=bogus ; \
	 unset TROLLIUSHOME ; \
	 rm -f config.cache ; \
	 if test -x configure; then \
	   cdir="." ; \
	   cd ..; \
	   LAM_TOP_SRCDIR="`pwd`"; \
	   cd romio; \
	 elif test -x ../$(top_srcdir)/romio/configure; then \
	   cdir="../$(top_srcdir)/romio"; \
	   tmp="`pwd`"; \
	   cd ../$(top_srcdir); \
	   LAM_TOP_SRCDIR="`pwd`"; \
	   cd $$tmp; \
	 elif test -x $(top_srcdir)/romio/configure; then \
	   cdir="$(top_srcdir)/romio"; \
	   tmp="`pwd`"; \
	   cd $(top_srcdir); \
	   LAM_TOP_SRCDIR="`pwd`"; \
	   cd $$tmp; \
	 else \
	   echo "Error!  I can't find the configure for the ROMIO package.  :-(" ; \
	   exit 1; \
	 fi; \
	 export LAMHCC LAMF77 LAMHOME CFLAGS_ENV LAM_TOP_BUILDDIR LAM_TOP_SRCDIR; \
	 $$cdir/configure \
		--prefix=$(DESTDIR)$(prefix) \
		-mpi=lam \
		-mpiincdir="$$LAM_TOP_SRCDIR/share/include" \
		-cc="$$LAM_TOP_BUILDDIR/tools/hcc/hcc" \
		-fc="$$LAM_TOP_BUILDDIR/tools/hf77/hf77" \
		-mpiolib="$$LAM_TOP_BUILDDIR/romio/lib/liblammpio.a" \
		$$ROMIO_DEBUG \
		-cflags="-lam-building $$CFLAGS_ENV" \
		-fflags="-lam-building $(FFLAGS) @ROMIO_FLAGS@" \
		@ROMIO_NOF77@ \
		-make=$(MAKE) \
		-mpilib="$$LAM_TOP_BUILDDIR/share/libmpi.la" \
		@ROMIO_USER_FLAGS@ && \
	 $(MAKE) && touch .lam_built; \
	)

romio-install:
	@ echo "Making install in romio"
	@ if test ! -f romio/.lam_built ; then \
	    $(MAKE) romio-all && $(MAKE) romio-install-redirect ; \
	  else \
	    $(MAKE) romio-install-redirect; \
	  fi

romio-install-redirect:
	@ (if test -d romio; then \
	     cd romio ; \
	     if test -f Makefile; then \
	       ( $(MAKE) install PREFIX=$(DESTDIR)$(prefix) \
			DATADIR=$(DESTDIR)$(datadir) \
			LIBDIR=$(DESTDIR)$(libdir) \
			INCLUDEDIR=$(DESTDIR)$(includedir) \
			MANDIR=$(DESTDIR)$(mandir); ) \
	     fi ; \
	   fi)

romio-examples:
	@ echo "Making examples in romio"
	@ (if test -d romio; then \
	     cd romio; \
	     if test "`echo $(ROMIO_EXAMPLES)`" != "" -a -f Makefile; then \
		if test -f .lam_built ; then \
		    ( cd test; \
		      unset TROLLIUSHOME LAMHOME LAMHCP LAMHCC; \
		      $(MAKE) CC=mpicc F77=mpif77 LIBS= USER_CFLAGS="$(CFLAGS)" USER_FFLAGS="$(FFLAGS) $(ROMIO_FLAGS)" ) ; \
		else \
		    echo "*** Error: it does not appear that ROMIO was built yet." ; \
		    echo "*** I cannot tell if LAM was built yet or not, so I will abort." ; \
		    echo "*** Please build ROMIO the normal LAM build interface" ; \
		    echo "*** and then attempt to build the ROMIO again." ; \
		fi; \
	     fi; \
	   fi )

romio-clean:
	@ echo "Making clean in romio"
	@ (if test -d romio; then \
	     cd romio; \
	     rm -f .lam_built; \
	     if test -f Makefile ; then \
		$(MAKE) clean; \
	     fi; \
	   fi )

romio-distclean:
	@ echo "Making distclean in romio"
	@ (if test -d romio; then \
	     cd romio; \
	     rm -f .lam_built; \
	     if test -f Makefile ; \
		then $(MAKE) cleanall; \
	     fi ; \
	   fi)

romio-uninstall:
	@ echo "Making uninstall in romio"
	@ if test -f romio/.lam_built ; then \
	    $(MAKE) romio-uninstall-redirect; \
	  fi

# This is just so ugly; it's painful.

romio-uninstall-redirect:
	@ ( cd romio; $(MAKE) uninstall PREFIX=$(DESTDIR)$(prefix) \
			DATADIR=$(DESTDIR)$(datadir) \
			LIBDIR=$(DESTDIR)$(libdir) \
			INCLUDEDIR=$(DESTDIR)$(includedir) \
			MANDIR=$(DESTDIR)$(mandir); )
	   if test -f $(DESTDIR)$(libdir)/liblammpio.a; then \
	     rm -f $(DESTDIR)$(libdir)/liblammpio.a; \
	   fi


# Be sure to set LAMHOME properly so that hcc/hcp/hf77 use the right
# libraries/include files (to avoid conflicts if the user may already
# have a LAM installed, and already have LAMHOME set somewhere else).

# Automakeizm -- check to see if we already built the bindings.  "make
# install" implicitly invokes "make all" first (in a roundabout way).

mpi2c++-all:
	@ echo "Making all in mpi2c++"
	@ rm -f tools/hcc/lamboot
	@ (if test ! -f mpi2c++/.lam_built; then \
		$(MAKE) mpi2c++-all-redirect; \
	   fi)

# Ick.  Because of the way MPI 2 C++'s configure.in works, it expects
# to find an installed LAM/MPI.  So it expects to find hcp/lamboot in
# the same directory (under the assumption that it's $prefix/bin).  So
# we have to sym link lamboot into tools/hcc during the build.  Ugh!
# We really should put a hook in MPI 2 C++ to make this better (a la
# ROMIO's hook for MPICH), but not right now...

# VPATHizms -- check to see if the "romio" dir exists.  If it doesn't,
# make it.  Then we have to go find the configure file.  If it's not
# in the romio dir, check ../$(top_srcdir)/romio.  If it's not there,
# barf.  Set LAM_TOP_BUILDDIR and LAM_TOP_SRCDIR as appropriate (hcc
# uses these variables to reset -I and -L paths).  

# libtoolizm -- very, very painful.  We must set libtool as the
# underlying LAMHCP because mpi2c++'s configure checks for the
# presence of libmpi, etc.  libtool does not understand C++ compilers
# or options, so an additional --mode switch must be insertted.  hcc
# had to be modified to look for libtool as the first arg in
# conjunction with building LAM and compiling C++ programs.  It will
# insert the right --mode switch, as appropriate.  It will also ditch
# the libtool arguments if it finds a -E, so that the *real*
# underlying compiler can act as a preprocessor.  Woof -- what a day.

# What sucks even worse is that CVS and the distscript.csh don't
# preserve timestamps properly, hence the automake-ized mpi2c++
# project tries to re-run aclocal and friends.  This is disasterous,
# because we don't have the maintainer tree here -- just the
# distribution tarball (e.g., acconfig.h is not shipped, so autoheader
# barfs).  So we have to do a really gross touch to get all the
# timestamps equal.  Don't laugh; it's the only thing that I can think
# to do.  :-(

mpi2c++-all-redirect: 
	@ echo
	@ echo "Compiling MPI 2 C++ bindings support"
	@ echo
	@ (LAM_TOP_BUILDDIR="`pwd`"; \
	 LAM_TOP_SRCDIR=$$LAM_TOP_BUILDDIR; \
	 if test ! -d mpi2c++; then mkdir mpi2c++; fi ; \
	 cd mpi2c++ ; \
	 LAMHCP="$$LAM_TOP_BUILDDIR/libtool --quiet $(CXX)" ; \
	 PATH="$$LAM_TOP_BUILDDIR/tools/hcc:$$PATH" ; \
	 CXXFLAGS="$(CXXFLAGS) $(USER_CXXFLAGS)"; \
	 LDFLAGS="$(LDFLAGS) $(USER_CXXLDFLAGS)"; \
	 LAMHOME=bogus ; \
	 TROLLIUSHOME=bogus ; \
	 unset LAMHOME TROLLIUSHOME; \
	 rm -f src/libmpi++.a; \
	 rm -f $$LAM_TOP_BUILDDIR/tools/hcc/lamboot ; \
	 $(LN_S) $$LAM_TOP_BUILDDIR/tools/lamboot/lamboot $$LAM_TOP_BUILDDIR/tools/hcc/lamboot; \
	 if test -x configure; then \
	   cdir="." ; \
	   cd ..; \
	   LAM_TOP_SRCDIR="`pwd`"; \
	   cd mpi2c++; \
	 elif test -x ../$(top_srcdir)/mpi2c++/configure; then \
	   cdir="../$(top_srcdir)/mpi2c++"; \
	   tmp="`pwd`"; \
	   cd ../$(top_srcdir); \
	   LAM_TOP_SRCDIR="`pwd`"; \
	   cd $$tmp; \
	 elif test -x $(top_srcdir)/mpi2c++/configure; then \
	   cdir="$(top_srcdir)/mpi2c++"; \
	   tmp="`pwd`"; \
	   cd $(top_srcdir); \
	   LAM_TOP_SRCDIR="`pwd`"; \
	   cd $$tmp; \
	 else \
	   echo "Error!  I can't find the configure for the MPI 2 C++ package.  :-(" ; \
	   exit 1; \
	 fi; \
	 MAKE="$(MAKE)"; \
	 export LAMHCP LAMHOME TROLLIUSHOME CXXFLAGS LDFLAGS LAM_TOP_BUILDDIR \
	    LAM_TOP_SRCDIR PATH MAKE ; \
	 $$cdir/configure \
		--prefix=$(DESTDIR)$(prefix) \
		--with-lam=$$LAM_TOP_BUILDDIR/tools/hcc \
		$(MPI2CPP_CONFIGURE_EXFLAGS) \
		--with-libopt= --with-examopt= \
		--with-lam-building && \
	 $(MAKE) all && touch .lam_built || rm -f $$LAM_TOP_BUILDDIR/tools/hcc/lamboot; \
	 rm -f $$LAM_TOP_BUILDDIR/tools/hcc/lamboot \
	)

mpi2c++-install:
	@ echo "Making install in mpi2c++"
	@ if test ! -f mpi2c++/.lam_built ; then \
	    $(MAKE) mpi2c++-all && $(MAKE) mpi2c++-install-redirect ; \
	  else \
	    $(MAKE) mpi2c++-install-redirect; \
	  fi

mpi2c++-install-redirect:
	@ (if test -d mpi2c++; then \
	     cd mpi2c++; \
	     if test -f Makefile ; then \
	       $(MAKE) install; \
	       mv $(DESTDIR)$(libdir)/libmpi++.a $(DESTDIR)$(libdir)/liblammpi++.a; \
	     fi; \
	   fi)

mpi2c++-examples:
	@ echo "Making examples in mpi2c++"
	@ (if test -d mpi2c++; then \
	     cd mpi2c++; \
	     if test "`echo $(MPI2CPP_EXAMPLES)`" != "" -a -f Makefile; then \
	       if test -f .lam_built ; then \
		    unset TROLLIUSHOME LAMHOME LAMHCC LAMHCP; \
		    $(MAKE) examples; \
	       else \
		    echo "*** Error: it does not appear that the MPI 2 C++ bindings were built yet." ; \
		    echo "*** I cannot tell if LAM was built yet or not, so I will abort." ; \
		    echo "*** Please build the MPI 2 C++ bindings through the normal LAM build interface" ; \
		    echo "*** and then attempt to build the MPI 2 C++ examples again." ; \
		    exit 1 ; \
	       fi; \
	    fi; \
	  fi)

mpi2c++-clean:
	@ echo "Making clean in mpi2c++"
	@ (if test -d mpi2c++; then \
	     cd mpi2c++; \
	     rm -f .lam_built; \
	     if test -f Makefile ; then \
	       $(MAKE) clean; \
	     fi; \
	   fi)

mpi2c++-distclean:
	@ echo "Making distclean in mpi2c++"
	@ (if test -d mpi2c++; then \
	     cd mpi2c++; \
	     rm -f .lam_built; \
	     if test -f Makefile ; then \
	       $(MAKE) distclean; \
	     fi; \
	  fi)

mpi2c++-uninstall:
	@ echo "Making uninstall in mpi2c++"
	@ if test -f mpi2c++/.lam_built ; then \
	    $(MAKE) mpi2c++-uninstall-redirect; \
	  fi

mpi2c++-uninstall-redirect:
	@ (if test -d mpi2c++; then \
	     cd mpi2c++; $(MAKE) uninstall; \
	     if test -f $(DESTDIR)$(libdir)/liblammpi++.a; then \
	       rm -f $(DESTDIR)$(libdir)/liblammpi++.a; \
	     fi; \
	   fi)

#
# For printing friendly messages at the end :-)
#

examples-done:
	@echo
	@echo "==========================================================================="
	@echo
	@echo "The examples for LAM/MPI $(LAM_VERSION) have been built."
	@echo
	@echo "Look in the subdirectories of examples/ for each of"
	@echo "the example programs.  Each subdirectory has a README file"
	@echo "that explains how to run it, etc."
	@echo
	@echo "==========================================================================="

all-done: .lam_built
.lam_built:
	@ echo
	@ echo "==========================================================================="
	@ echo
	@ echo "LAM/MPI $(LAM_VERSION) has been built."
	@ echo
	@ echo "You now need to install it with \"make install\""
	@ echo
	@ echo "==========================================================================="
	@ touch .lam_built

install-exec-hook:
	@echo
	@echo "==========================================================================="
	@echo
	@echo "Installation of LAM/MPI $(LAM_VERSION) is complete."
	@echo
	@echo "Be sure to visit the LAM/MPI web page: http://www.lam-mpi.org/"
	@echo
	@echo "The FAQ and LAM mailing list archives (both accessable from the web page)"
	@echo "contain much information about getting started with LAM/MPI, as well as"
	@echo "solutions to common problems."
	@echo
	@echo "==========================================================================="
	@echo

#
# For making the distribution.  LAM maintainers only.  It won't work
# for you.  :-)
#
# Requires the "sowing" package from ftp://ftp.mcs.anl.gov/ to make
# the man pages.
#

dist-hook:
	csh -f config/distscript.csh $(DESTDIR)$(distdir)

#
# This is fairly fragile; don't interrupt it!
#

lamdist64:
	mv VERSION VERSION.save
	cp VERSION-6.4 VERSION
	p="`pwd`"; \
	lv="`sh config/get_lam_version $$p --full`"; \
	$(MAKE) VERSION="$$lv" dist
	rm -f VERSION
	mv VERSION.save VERSION

lamdist: dist
	@(mkdir /tmp/lam-dist.$$; \
	  chmod 700 /tmp/lam-dist.$$; \
	  p="`pwd`"; \
	  cd /tmp/lam-dist.$$; \
	  echo "*** Making lam-$(LAM_VERSION).tar.Z..."; \
	  cp $$p/lam-$(LAM_VERSION).tar.gz .; \
	  gunzip lam-$(LAM_VERSION).tar.gz; \
	  compress lam-$(LAM_VERSION).tar; \
	  mv lam-$(LAM_VERSION).tar.Z $$p; \
	  echo "*** Making lam-$(LAM_VERSION).tar.bz2..."; \
	  cp $$p/lam-$(LAM_VERSION).tar.gz .; \
	  gunzip lam-$(LAM_VERSION).tar.gz; \
	  bzip2 lam-$(LAM_VERSION).tar; \
	  mv lam-$(LAM_VERSION).tar.bz2 $$p; \
	  cd $p;\
	  rm -rf /tmp/lam-dist.$$; )

#
# No SOURCEFILES, but we do need the rule
#

include $(top_srcdir)/Makefile.depend