1# -*- Mode: Makefile; -*-
2# vim: set ft=automake :
3#
4# (C) 2011 by Argonne National Laboratory.
5#     See COPYRIGHT in top-level directory.
6#
7
8# mix in the "make testing" rule and other boilerplate
9include $(top_srcdir)/Makefile.mtest
10
11ACLOCAL_AMFLAGS = -I confdb
12
13static_subdirs = util attr basic datatype coll comm errhan group info init \
14                 pt2pt rma topo errors manual perf
15all_lang_subdirs = f77 cxx f90
16
17# DIST_SUBDIRS must be a superset of SUBDIRS, and automake must be able to
18# *statically* compute its contents.  The good news is that we can mostly avoid
19# duplication because automake is able to "see" into simple variable
20# assignments that are not driven by a configure @-substitution variable.
21DIST_SUBDIRS = $(static_subdirs) io $(all_lang_subdirs) threads spawn .
22SUBDIRS      = $(static_subdirs) $(iodir) $(otherlangs) $(threadsdir) $(spawndir) .
23
24EXTRA_DIST = maint/common.defn maint/f77tof90.in maint/testmerge.in maint/updatefiles testlist.in
25
26DISTCLEANFILES = config.system
27
28## here are automakefile entries for the test/mpi/include dir
29noinst_HEADERS = include/mpitest.h include/mpitestcxx.h include/mpithreadtest.h
30nodist_noinst_HEADERS = include/mpitestconf.h
31
32# Need to patch some things up:
33# Make sure to disable rebuilding the autotools related files - the
34# receiver of this distribution may not have the necessary tools and
35# should not need them.  Finally, the distributed configure must disable
36# maintainer targets by default - otherwise, the unsuspecting user will
37# see automake et al attempt to rebuild the autotools, which is likely to
38# fail unless the user has the correct versions of all of the tools
39dist-hook:
40	cd $(distdir) && \
41	    sed -e 's/AM_MAINTAINER_MODE.*/AM_MAINTAINER_MODE([disable])/' \
42	        configure.ac > conftmp.ac && mv conftmp.ac configure.ac
43	cd $(distdir) && $(AUTOMAKE) --add-missing
44	cd $(distdir) && $(AUTOMAKE) --foreign
45	cd $(distdir) && $(ACLOCAL) -Iconfdb
46	cd $(distdir) && $(AUTOCONF) -Iconfdb
47	cd $(distdir) && $(AUTOHEADER) -Iconfdb
48