2005-12-14 05:37:15 +08:00
|
|
|
## config/examples.am
|
2007-02-21 23:43:35 +08:00
|
|
|
## (Use double hashes for copyright notice so that automake treats it as
|
|
|
|
## comments and does not pass it to Makefile.in)
|
|
|
|
## Copyright by The HDF Group.
|
|
|
|
## 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
|
2017-04-15 00:54:16 +08:00
|
|
|
## the COPYING file, which can be found at the root of the source code
|
|
|
|
## distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
|
|
|
|
## If you do not have access to either file, you may request a copy from
|
|
|
|
## help@hdfgroup.org.
|
2005-12-14 05:37:15 +08:00
|
|
|
|
|
|
|
## Textually included near the end of HDF5 Makefiles in example directories.
|
|
|
|
## Contains boilerplate for building, installing, and cleaning example
|
|
|
|
## programs.
|
|
|
|
|
|
|
|
# We can't tell automake about example programs, because they need to be
|
|
|
|
# built using h5cc (or h5fc, etc.) instead of the standard compilers.
|
|
|
|
# This creates some extra work for us.
|
|
|
|
|
|
|
|
## The Makefile.am that includes this boilerplate needs to define the
|
|
|
|
## following:
|
|
|
|
##
|
|
|
|
## TEST_PROG and TEST_PROG_PARA
|
|
|
|
## We assume that all test programs in this directory are examples.
|
|
|
|
##
|
|
|
|
## INSTALL_FILES
|
|
|
|
## The source files that the examples use which should be installed.
|
2010-07-09 10:52:14 +08:00
|
|
|
## INSTALL_SCRIPT_FILES
|
|
|
|
## INSTALL_TOP_SCRIPT_FILES
|
2012-06-03 02:54:58 +08:00
|
|
|
## INSTALL_TOP_FILES
|
2005-12-14 05:37:15 +08:00
|
|
|
##
|
|
|
|
## EXAMPLEDIR
|
|
|
|
## The directory into which examples should be installed.
|
|
|
|
##
|
|
|
|
## Build rules for $(EXTRA_PROG).
|
|
|
|
## Dependencies for example programs.
|
|
|
|
## Automake will supply neither of these.
|
|
|
|
##
|
|
|
|
|
|
|
|
# Assume that all tests in this directory are examples, and tell
|
|
|
|
# conclude.am when to build them.
|
2012-08-24 00:07:43 +08:00
|
|
|
EXTRA_PROG = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA)
|
2005-12-14 05:37:15 +08:00
|
|
|
|
|
|
|
# We need to tell automake what to clean
|
|
|
|
MOSTLYCLEANFILES=*.raw *.meta *.o
|
|
|
|
CHECK_CLEANFILES+=*.h5
|
2012-08-27 03:10:01 +08:00
|
|
|
CLEANFILES=$(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA)
|
2005-12-14 05:37:15 +08:00
|
|
|
|
|
|
|
# How to create EXAMPLEDIR if it doesn't already exist
|
|
|
|
$(EXAMPLEDIR):
|
|
|
|
-$(top_srcdir)/bin/mkdirs $@
|
2010-07-09 10:52:14 +08:00
|
|
|
$(EXAMPLETOPDIR):
|
|
|
|
-$(top_srcdir)/bin/mkdirs $@
|
2005-12-14 05:37:15 +08:00
|
|
|
|
|
|
|
# Install and uninstall rules. We install the source files, not the
|
|
|
|
# example programs themselves.
|
|
|
|
install-data-local:
|
|
|
|
@$(MAKE) $(AM_MAKEFLAGS) install-examples
|
|
|
|
uninstall-local:
|
|
|
|
@$(MAKE) $(AM_MAKEFLAGS) uninstall-examples
|
|
|
|
|
2012-06-03 02:54:58 +08:00
|
|
|
install-examples: $(EXAMPLEDIR) $(INSTALL_FILES)
|
2005-12-14 05:37:15 +08:00
|
|
|
@for f in X $(INSTALL_FILES); do \
|
|
|
|
if test $$f != X; then \
|
2010-10-07 22:42:52 +08:00
|
|
|
(set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \
|
|
|
|
chmod a-x $(EXAMPLEDIR)/$$f; \
|
2005-12-14 05:37:15 +08:00
|
|
|
fi; \
|
|
|
|
done
|
2010-07-09 10:52:14 +08:00
|
|
|
@for f in X $(INSTALL_SCRIPT_FILES); do \
|
|
|
|
if test $$f != X; then \
|
|
|
|
(set -x; $(INSTALL) $$f $(EXAMPLEDIR)/. || exit 1);\
|
|
|
|
fi; \
|
|
|
|
done
|
2012-06-03 02:54:58 +08:00
|
|
|
@for f in X $(INSTALL_TOP_FILES); do \
|
|
|
|
if test $$f != X; then \
|
|
|
|
(set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \
|
|
|
|
chmod a-x $(EXAMPLETOPDIR)/$$f;\
|
|
|
|
fi; \
|
|
|
|
done
|
2010-07-09 10:52:14 +08:00
|
|
|
@for f in X $(INSTALL_TOP_SCRIPT_FILES); do \
|
|
|
|
if test $$f != X; then \
|
|
|
|
(set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \
|
|
|
|
fi; \
|
|
|
|
done
|
2005-12-14 05:37:15 +08:00
|
|
|
|
|
|
|
uninstall-examples:
|
2010-07-09 10:52:14 +08:00
|
|
|
@if test -n "$(INSTALL_FILES)" -a -d $(EXAMPLEDIR); then \
|
|
|
|
set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_FILES); \
|
2014-04-09 12:55:49 +08:00
|
|
|
fi
|
2010-07-09 10:52:14 +08:00
|
|
|
@if test -n "$(INSTALL_SCRIPT_FILES)" -a -d $(EXAMPLEDIR); then \
|
|
|
|
set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_SCRIPT_FILES); \
|
2014-04-09 12:55:49 +08:00
|
|
|
fi
|
2012-06-03 02:54:58 +08:00
|
|
|
@if test -n "$(INSTALL_TOP_FILES)" -a -d $(EXAMPLETOPDIR); then \
|
|
|
|
set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_FILES); \
|
2014-04-09 12:55:49 +08:00
|
|
|
fi
|
2010-07-09 10:52:14 +08:00
|
|
|
@if test -n "$(INSTALL_TOP_SCRIPT_FILES)" -a -d $(EXAMPLETOPDIR); then \
|
|
|
|
set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_SCRIPT_FILES); \
|
2014-04-09 12:55:49 +08:00
|
|
|
fi
|
2005-12-14 05:37:15 +08:00
|
|
|
|
|
|
|
installcheck-local:
|
2006-06-22 07:15:08 +08:00
|
|
|
@if test "$(STATIC_SHARED)" = "static, shared"; then \
|
|
|
|
H5CCFLAGS="-shlib" $(MAKE) $(AM_MAKEFLAGS) check; \
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) clean; \
|
|
|
|
H5CCFLAGS="" $(MAKE) $(AM_MAKEFLAGS) check; \
|
2014-04-09 12:55:49 +08:00
|
|
|
elif test "$(STATIC_SHARED)" = "shared"; then \
|
2006-06-22 07:15:08 +08:00
|
|
|
H5CCFLAGS="-shlib" $(MAKE) $(AM_MAKEFLAGS) check; \
|
2014-04-09 12:55:49 +08:00
|
|
|
else \
|
2006-06-22 07:15:08 +08:00
|
|
|
$(MAKE) $(AM_MAKEFLAGS) check; \
|
2014-04-09 12:55:49 +08:00
|
|
|
fi
|
|
|
|
@if test "$(INSTALL_FILES)" -a $(TEST_EXAMPLES_SCRIPT) -a -d $(EXAMPLEDIR); then \
|
|
|
|
echo "============================"; \
|
|
|
|
echo "Testing $(TEST_EXAMPLES_SCRIPT)"; \
|
|
|
|
echo "============================"; \
|
|
|
|
(cd $(EXAMPLEDIR); \
|
|
|
|
/bin/sh ./$(TEST_EXAMPLES_SCRIPT);) \
|
|
|
|
fi
|
2005-12-14 05:37:15 +08:00
|
|
|
|