diff options
author | James Laird <jlaird@hdfgroup.org> | 2005-02-01 03:17:02 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2005-02-01 03:17:02 (GMT) |
commit | 26303241febadd20aea77fc8a1d48f05823170af (patch) | |
tree | 4ba1d92050fa6cc33feab6a38bc9778f71bbb146 /fortran/examples/Makefile.am | |
parent | 9f17319144fca94a852fd500487b0e4ae48e0997 (diff) | |
download | hdf5-26303241febadd20aea77fc8a1d48f05823170af.zip hdf5-26303241febadd20aea77fc8a1d48f05823170af.tar.gz hdf5-26303241febadd20aea77fc8a1d48f05823170af.tar.bz2 |
[svn-r9902] Purpose:
Configuration feature
Description:
HDF5 now uses automake to generate Makefiles
Solution:
Makefile.in files are now generated from Makefile.am files.
To reconfigure (after chaning a Makefile.am or configure.in):
/bin/sh bin/reconfigure.sh
Platforms tested:
Many
Diffstat (limited to 'fortran/examples/Makefile.am')
-rw-r--r-- | fortran/examples/Makefile.am | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/fortran/examples/Makefile.am b/fortran/examples/Makefile.am new file mode 100644 index 0000000..6f32ce9 --- /dev/null +++ b/fortran/examples/Makefile.am @@ -0,0 +1,105 @@ +# +# Copyright by the Board of Trustees of the University of Illinois. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the files COPYING and Copyright.html. COPYING can be found at the root +# of the source code distribution tree; Copyright.html can be found at the +# root level of an installed copy of the electronic HDF5 document set and +# is linked from the top-level documents page. It can also be found at +# http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have +# access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. +## +## Makefile.am +## Run automake to generate a Makefile.in from this file. +## +# +# HDF5-Fortran Examples Makefile(.in) +# + +include $(top_srcdir)/config/commence.am + +# These are the programs that 'make all' or 'make tests' will build and +# that 'make check' will run. List them in the order in which they should +# be run. +# We don't tell automake about these programs so that it doesn't try to +# compile them with the regular fortran compiler. +TEST_PROG=dsetexample fileexample rwdsetexample attrexample groupexample \ + grpsexample grpdsetexample hyperslab selectele grpit refobjexample \ + refregexample mountexample compound + +# Tell configure.in when to build examples +EXTRA_PROG=$(TEST_PROG) +EXAMPLE_PROG=$(EXTRA_PROG) + +# List files to be installed here +INSTALL_FILES=dsetexample.f90 fileexample.f90 rwdsetexample.f90 \ + attrexample.f90 groupexample.f90 grpsexample.f90 grpdsetexample.f90 \ + hyperslab.f90 selectele.f90 grpit.f90 refobjexample.f90 \ + refregexample.f90 mountexample.f90 compound.f90 + +# Tell automake which files to clean +CLEANFILES=*.h5 $(EXTRA_PROG) + +# Tell automake how to build examples using h5fc +# Additional dependencies for the examples are listed below +$(EXTRA_PROG): $(LIBHDF5) $(LIBH5F) +if BUILD_PARALLEL_CONDITIONAL + $(H5FC_PP) $(FFLAGS) -o $@ $(srcdir)/$@.f90; +else + $(H5FC) $(FFLAGS) -o $@ $(srcdir)/$@.f90; +endif + +# Tell automake how to install examples +EXAMPLEDIR=$(docdir)/hdf5/examples/fortran + +$(EXAMPLEDIR): + -$(top_srcdir)/bin/mkdirs $@ + +install-data-local: + $(MAKE) install-examples +uninstall-local: + $(MAKE) uninstall-examples + +# We're installing source files, not the example programs. Add .f90 to each +# example program to get its source (and do the same when uninstalling). +install-examples: $(EXAMPLEDIR) + @for f in X $(INSTALL_FILES); do \ + if test $$f != X; then \ + (set -x; $(INSTALL_DATA) $(top_srcdir)/fortran/examples/$$f $(EXAMPLEDIR)/. || exit 1);\ + fi; \ + done + +uninstall-examples: + @if test -n "$(INSTALL_FILES)" -a -d $(EXAMPLEDIR); then \ + set -x; cd $(EXAMPLEDIR) && $(RM) $(EXAMPLE_PROG); \ + fi + +check-install: + $(MAKE) installcheck +installcheck-local: + $(MAKE) check + +# List dependencies for each example. Normally, automake would take +# care of this for us, but if we tell automake about the programs it +# will try to build them with the normal C compiler, not h5cc. This is +# an inelegant way of solving the problem. +# All programs share the same build rule and a dependency on the main hdf5 +# and fortran libraries above. +dsetexample: dsetexample.f90 +fileexample: fileexample.f90 +rwdsetexample: rwdsetexample.f90 +attrexample: attrexample.f90 +groupexample: groupexample.f90 +grpsexample: grpsexample.f90 +grpdsetexample: grpdsetexample.f90 +hyperslab: hyperslab.f90 +selectele: selectele.f90 +grpit: grpit.f90 +refobjexample: refobjexample.f90 +refregexample: refregexample.f90 +mountexample: mountexample.f90 +compound: compound.f90 + +include $(top_srcdir)/config/conclude.am |