summaryrefslogtreecommitdiffstats
path: root/c++/examples
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2005-12-09 20:59:11 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2005-12-09 20:59:11 (GMT)
commitb1fd3f565750a18246239cdac50e433d6d668524 (patch)
treef09179e1fb2a04e01983c85f9a3873c159fefda7 /c++/examples
parent9124030f911f002bd49ec8bccd4c051df410cc72 (diff)
downloadhdf5-b1fd3f565750a18246239cdac50e433d6d668524.zip
hdf5-b1fd3f565750a18246239cdac50e433d6d668524.tar.gz
hdf5-b1fd3f565750a18246239cdac50e433d6d668524.tar.bz2
[svn-r11780] Purpose:
Added high-level example directories Description: Refactored common code out of examples Makefiles.am, added high-level example directories, added packet table examples. Solution: Examples now draw from a common config/examples.am file, which contains rules for installing, uninstalling, and cleaning examples. High-level example directories are mostly empty, except for the C and C++ packet table tests. Platforms tested: mir, sleipnir, copper, shanti
Diffstat (limited to 'c++/examples')
-rw-r--r--c++/examples/Makefile.am49
-rw-r--r--c++/examples/Makefile.in90
2 files changed, 45 insertions, 94 deletions
diff --git a/c++/examples/Makefile.am b/c++/examples/Makefile.am
index e82c3cd..f60b6d7 100644
--- a/c++/examples/Makefile.am
+++ b/c++/examples/Makefile.am
@@ -24,11 +24,6 @@ include $(top_srcdir)/config/commence.am
# which 'make check' will run. List them in the order they should be run.
TEST_PROG=create readdata writedata compound extend_ds chunks h5group
-EXAMPLE_PROG=$(TEST_PROG)
-
-# Tell conclude.in when to build the examples
-EXTRA_PROG=$(TEST_PROG)
-
# These are the example files to be installed
INSTALL_FILES=create.cpp readdata.cpp writedata.cpp compound.cpp \
extend_ds.cpp chunks.cpp h5group.cpp
@@ -37,53 +32,12 @@ INSTALL_FILES=create.cpp readdata.cpp writedata.cpp compound.cpp \
readdata.chkexe_: create.chkexe_
chunks.chkexe_: extend_ds.chkexe_
-# These are the files that 'make clean' (and derivatives) will remove from this
-# directory. Since automake doesn't know about the examples, we need to
-# tell it to clean the example programs, too.
-CHECK_CLEANFILES+=*.h5
-MOSTLYCLEANFILES=$(EXTRA_PROG:=.o)
-CLEANFILES=$(EXTRA_PROG)
-
# Tell conclude.am that these are C++ tests.
HDF_CXX=yes
-# How to install examples
+# Where to install examples
EXAMPLEDIR=$(docdir)/hdf5/examples/c++
-$(EXAMPLEDIR):
- -$(top_srcdir)/bin/mkdirs $@
-
-install-data-local:
- @$(MAKE) install-examples
-uninstall-local:
- @$(MAKE) uninstall-examples
-
-# Some C++ compilers/linkers will create a directory named ii_files,
-# which should be cleaned.
-mostlyclean-local:
- if test -d ii_files; then \
- $(RM) -rf ii_files; \
- fi
-
-# Install source files, which are the examples with .cpp suffixes. Do the same
-# for uninstall.
-install-examples: $(EXAMPLEDIR)
- @for f in X $(INSTALL_FILES); do \
- if test $$f != X; then \
- (set -x; $(INSTALL_DATA) $(top_srcdir)/c++/examples/$$f $(EXAMPLEDIR)/. || exit 1);\
- fi; \
- done
-
-uninstall-examples:
- @if test -n "$(INSTALL_FILES)" -a -d $(EXAMPLEDIR); then \
- set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_FILES).cpp; \
- fi
-
-check-install:
- @$(MAKE) $(AM_MAKEFLAGS) installcheck
-installcheck-local:
- @$(MAKE) $(AM_MAKEFLAGS) check
-
# How to build programs using h5c++
$(EXTRA_PROG): $(LIBHDF5) $(LIBH5CPP)
$(H5CPP) $(CPPFLAGS) -o $@ $(srcdir)/$@.cpp
@@ -100,4 +54,5 @@ extend_ds: $(srcdir)/extend_ds.cpp
chunks: $(srcdir)/chunks.cpp
h5group: $(srcdir)/h5group.cpp
+include $(top_srcdir)/config/examples.am
include $(top_srcdir)/config/conclude.am
diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in
index 6e54d86..742b0d9 100644
--- a/c++/examples/Makefile.in
+++ b/c++/examples/Makefile.in
@@ -29,6 +29,10 @@
#
# HDF5 Library Examples Makefile(.in)
#
+
+# 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.
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
@@ -53,7 +57,8 @@ build_triplet = @build@
host_triplet = @host@
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/config/commence.am \
- $(top_srcdir)/config/conclude.am
+ $(top_srcdir)/config/conclude.am \
+ $(top_srcdir)/config/examples.am
subdir = c++/examples
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
@@ -301,33 +306,32 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chkexe files are used to mark tests that have run successfully.
# .chklog files are output from those tests.
# *.clog are from the MPE option.
-
-# These are the files that 'make clean' (and derivatives) will remove from this
-# directory. Since automake doesn't know about the examples, we need to
-# tell it to clean the example programs, too.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5
# These are the programs that 'make all' or 'make prog' will build and
# which 'make check' will run. List them in the order they should be run.
TEST_PROG = create readdata writedata compound extend_ds chunks h5group
-EXAMPLE_PROG = $(TEST_PROG)
-
-# Tell conclude.in when to build the examples
-EXTRA_PROG = $(TEST_PROG)
# These are the example files to be installed
INSTALL_FILES = create.cpp readdata.cpp writedata.cpp compound.cpp \
extend_ds.cpp chunks.cpp h5group.cpp
-MOSTLYCLEANFILES = $(EXTRA_PROG:=.o)
-CLEANFILES = $(EXTRA_PROG)
# Tell conclude.am that these are C++ tests.
HDF_CXX = yes
-# How to install examples
+# Where to install examples
EXAMPLEDIR = $(docdir)/hdf5/examples/c++
+# Assume that all tests in this directory are examples, and tell
+# conclude.am when to build them.
+EXAMPLE_PROG = $(TEST_PROG_PARA) $(TEST_PROG)
+EXTRA_PROG = $(EXAMPLE_PROG)
+
+# We need to tell automake what to clean
+MOSTLYCLEANFILES = *.raw *.meta *.o
+CLEANFILES = $(TEST_PROG) $(TEST_PROG_PARA)
+
# Automake needs to be taught how to build lib, progs, and tests targets.
# These will be filled in automatically for the most part (e.g.,
# lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and
@@ -347,7 +351,7 @@ TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chkexe_)
all: all-am
.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/examples.am $(top_srcdir)/config/conclude.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -530,40 +534,6 @@ check-install: installcheck
readdata.chkexe_: create.chkexe_
chunks.chkexe_: extend_ds.chkexe_
-$(EXAMPLEDIR):
- -$(top_srcdir)/bin/mkdirs $@
-
-install-data-local:
- @$(MAKE) install-examples
-uninstall-local:
- @$(MAKE) uninstall-examples
-
-# Some C++ compilers/linkers will create a directory named ii_files,
-# which should be cleaned.
-mostlyclean-local:
- if test -d ii_files; then \
- $(RM) -rf ii_files; \
- fi
-
-# Install source files, which are the examples with .cpp suffixes. Do the same
-# for uninstall.
-install-examples: $(EXAMPLEDIR)
- @for f in X $(INSTALL_FILES); do \
- if test $$f != X; then \
- (set -x; $(INSTALL_DATA) $(top_srcdir)/c++/examples/$$f $(EXAMPLEDIR)/. || exit 1);\
- fi; \
- done
-
-uninstall-examples:
- @if test -n "$(INSTALL_FILES)" -a -d $(EXAMPLEDIR); then \
- set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_FILES).cpp; \
- fi
-
-check-install:
- @$(MAKE) $(AM_MAKEFLAGS) installcheck
-installcheck-local:
- @$(MAKE) $(AM_MAKEFLAGS) check
-
# How to build programs using h5c++
$(EXTRA_PROG): $(LIBHDF5) $(LIBH5CPP)
$(H5CPP) $(CPPFLAGS) -o $@ $(srcdir)/$@.cpp
@@ -580,6 +550,32 @@ extend_ds: $(srcdir)/extend_ds.cpp
chunks: $(srcdir)/chunks.cpp
h5group: $(srcdir)/h5group.cpp
+# How to create EXAMPLEDIR if it doesn't already exist
+$(EXAMPLEDIR):
+ -$(top_srcdir)/bin/mkdirs $@
+
+# 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
+
+install-examples: $(EXAMPLEDIR) $(INSTALL_FILES)
+ @for f in X $(INSTALL_FILES); do \
+ if test $$f != X; then \
+ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1);\
+ fi; \
+ done
+
+uninstall-examples:
+ @if test -n "$(INSTALL_FILES)" -a -d $(EXAMPLEDIR); then \
+ set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_FILES); \
+ fi
+
+installcheck-local:
+ @$(MAKE) $(AM_MAKEFLAGS) check
+
# lib/progs/tests targets recurse into subdirectories. build-* targets
# build files in this directory.
build-lib: $(LIB)