From 5e834c4cbc2353be2c9efd0f55dbdb23f87d9650 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 21 Sep 2001 18:50:15 -0500 Subject: [svn-r4466] Purpose: Feature Add Description: Added "install-example" and "install-all" to the Makefile system. The behaviour of the "make install*" options: make install - Installs binaries, libraries, include files, and example programs. make install-examples - Installs only the example programs. The directories are: ${prefix}/doc/hdf5/examples/{c,c++,fortran} make install-all - Install the binaries, libraries, include files, example programs, and documentation. The whole kit-n'-caboodle. make uninstall-examples - Get rid of those example files (but not the ${prefix}/doc/hdf5/examples/... directories) There's a new bin/ program which helps create directories which are deeply nested called "mkdirs". It's a simple shell script. Platforms tested: Linux --- MANIFEST | 1 + Makefile.in | 41 ++++++++++++++++++++++++++++++------ bin/mkdirs | 26 +++++++++++++++++++++++ c++/Makefile.in | 11 +++++++--- c++/config/commence.in | 1 + c++/config/conclude.in | 47 ++++++++++++++---------------------------- c++/examples/Makefile.in | 11 ++++++++-- config/commence.in | 1 + config/conclude.in | 26 +++++++++++++++++++---- configure | 46 +++++++++++++++++------------------------ configure.in | 49 ++++++++++++++++++++------------------------ examples/Makefile.in | 22 ++++++++++++-------- fortran/Makefile.in | 13 ++++++++---- fortran/config/commence.in | 1 + fortran/config/conclude.in | 48 +++++++++++++++---------------------------- fortran/examples/Makefile.in | 9 ++++++-- 16 files changed, 206 insertions(+), 147 deletions(-) create mode 100755 bin/mkdirs diff --git a/MANIFEST b/MANIFEST index e485530..c8c143c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -32,6 +32,7 @@ ./bin/locate_hdf4 ./bin/ltconfig ./bin/ltmain.sh +./bin/mkdirs ./bin/release ./bin/runtest _DO_NOT_DISTRIBUTE_ ./bin/snapshot diff --git a/Makefile.in b/Makefile.in index a6f37df..e0be549 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,8 @@ ## Top-level HDF5 Makefile(.in) ## -## Copyright (C) 1997 National Center for Supercomputing Applications. -## All rights reserved. +## Copyright (C) 1997, 1998, 1999, 2000, 2001 +## National Center for Supercomputing Applications +## All rights reserved. ## ## ## This makefile mostly just reinvokes make in the various subdirectories @@ -65,13 +66,41 @@ tests TAGS dep depend: (cd $$d && $(MAKE) $@) || exit 1; \ done +install-all: + @@SETX@; for d in dummy @subdirs@; do \ + if test $$d != "dummy"; then \ + (cd $$d && $(MAKE) $@) || exit 1; \ + fi; \ + done + @$(MAKE) install + @$(MAKE) install-doc + @$(LT) --mode=finish $(libdir) + install: @@SETX@; for d in $(SUBDIRS); do \ (cd $$d && $(MAKE) $@) || exit 1; \ done - @$(LT) --mode=finish $(libdir); + @$(MAKE) install-examples + @$(LT) --mode=finish $(libdir) + +install-examples: + @@SETX@; for d in dummy @subdirs@; do \ + if test $$d != "dummy"; then \ + (cd $$d && $(MAKE) $@) || exit 1; \ + fi; \ + done + (cd examples && $(MAKE) $@) || exit 1; + +uninstall-examples: + @@SETX@; for d in dummy @subdirs@; do \ + if test $$d != "dummy"; then \ + (cd $$d && $(MAKE) $@) || exit 1; \ + fi; \ + done + (cd examples && $(MAKE) $@) || exit 1; install-doc: + @$(MAKE) install-examples (cd doc && $(MAKE) $@) || exit 1; uninstall-doc: @@ -88,13 +117,13 @@ H5Tinit.c: mostlyclean distclean maintainer-clean clean mostlyclean: - @@SETX@; for d in $(SUBDIRS) doc perform examples pablo; do \ + @@SETX@; for d in $(SUBDIRS) doc perform examples pablo; do \ (cd $$d && $(MAKE) $@); \ done -$(RM) conftest conftest.c distclean: - @@SETX@; for d in $(SUBDIRS) doc perform examples pablo; do \ + @@SETX@; for d in $(SUBDIRS) doc perform examples pablo; do \ (cd $$d && $(MAKE) $@); \ done -$(RM) config/commence config/conclude @@ -106,7 +135,7 @@ distclean: maintainer-clean: @echo "This target is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." - @@SETX@; for d in $(SUBDIRS) doc perform examples pablo; do \ + @@SETX@; for d in $(SUBDIRS) doc perform examples pablo; do \ (cd $$d && $(MAKE) $@); \ done -$(RM) config.cache config.log config.status src/H5config.h diff --git a/bin/mkdirs b/bin/mkdirs new file mode 100755 index 0000000..3d689ad --- /dev/null +++ b/bin/mkdirs @@ -0,0 +1,26 @@ +#! /bin/sh +# +# Copyright (C) 2001 +# National Center for Supercomputing Applications +# All rights reserved. +# +# This is a small program which will create directories n-levels deep. +# You just call it with something like: +# +# mkdirs /tmp/foo/bar/baz +# +# and it will create all the directories from /tmp down to baz which +# don't exist. +# +chmodprog="${CHMODPROG-chmod}" +mkdirprog="${MKDIRPROG-mkdir}" + +make_dir () { + if ! test -d $1; then + make_dir `echo $1 | sed -e 's#/[^/]*$##'` + $mkdirprog $1 + $chmodprog 755 $1 + fi +} + +make_dir `echo $1 | sed -e 's#/$##'` diff --git a/c++/Makefile.in b/c++/Makefile.in index 25034ce..3f18b9b 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -1,7 +1,8 @@ ## Top-level HDF5-C++ Makefile(.in) ## -## Copyright (C) 2000 National Center for Supercomputing Applications. -## All rights reserved. +## Copyright (C) 2000, 2001 +## National Center for Supercomputing Applications +## All rights reserved. ## ## ## This makefile mostly just reinvokes make in the various subdirectories @@ -77,12 +78,16 @@ tests TAGS dep depend: (cd $$d && $(MAKE) $@) || exit 1; \ done -install: +install-all install: @@SETX@; for d in $(SUBDIRS); do \ (cd $$d && $(MAKE) $@) || exit 1; \ done + @$(MAKE) install-examples @$(LT) --mode=finish $(libdir); +install-examples: + (cd examples && $(MAKE) $@) || exit 1; + .PHONY: all lib progs test _test install uninstall dep depend clean \ mostlyclean distclean maintainer-clean diff --git a/c++/config/commence.in b/c++/config/commence.in index 54440d8..780e6c8 100644 --- a/c++/config/commence.in +++ b/c++/config/commence.in @@ -56,6 +56,7 @@ LT_UNINSTALL=$(LT) --mode=uninstall $(RM) ## complains if it sees a reference to a variable which has never been ## defined. The main makefile is free to redefine these to something else. DOCDIR=$(docdir) +EXAMPLEDIR=$(docdir) LIB= LIB_SRC= LIB_OBJ= diff --git a/c++/config/conclude.in b/c++/config/conclude.in index ba55c21..2bbd1c3 100644 --- a/c++/config/conclude.in +++ b/c++/config/conclude.in @@ -54,16 +54,16 @@ check test _test: tests ## Make installation directories directories if they don't exist. $(libdir): - mkdir $@ && chmod 755 $@ + $(top_srcdir)/bin/mkdirs $@ $(includedir): - mkdir $@ && chmod 755 $@ + $(top_srcdir)/bin/mkdirs $@ $(bindir): - mkdir $@ && chmod 755 $@ + $(top_srcdir)/bin/mkdirs $@ -$(DOCDIR): - mkdir $@ && chmod 755 $@ +$(EXAMPLEDIR): + $(top_srcdir)/bin/mkdirs $@ ## Install the library, the public header files, and public programs. install: $(PUB_LIB) $(PUB_HDR) $(PUB_PROGS) $(libdir) $(includedir) $(bindir) @@ -91,24 +91,18 @@ install: $(PUB_LIB) $(PUB_HDR) $(PUB_PROGS) $(libdir) $(includedir) $(bindir) fi; \ done -## Install the documents. -install-doc: $(PUB_DOCS) $(DOCDIR) - @for d in X $(SUBDIRS); do \ - if test $$d != X; then \ - (set -x; cd $$d && $(MAKE) $@) || exit 1; \ - fi; \ - done - @for f in X $(PUB_DOCS); do \ - if test $$f != X; then \ - if test -f $$f; then \ - (set -x; $(INSTALL_DATA) $$f $(DOCDIR)/. || exit 1); \ - else \ - (set -x; $(INSTALL_DATA) $(srcdir)/$$f $(DOCDIR)/. || \ - exit 1); \ - fi; \ - fi; \ +install-examples: $(EXAMPLE_PROGS) $(EXAMPLEDIR) + @for f in X $(EXAMPLE_PROGS); do \ + if test $$f != X; then \ + (set -x; $(INSTALL_DATA) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1);\ + fi; \ done +uninstall-examples: + @if test -n "$(EXAMPLE_PROGS)"; then \ + set -x; cd $(EXAMPLEDIR) && $(RM) $(EXAMPLE_DOCS); \ + fi + ## Removes those things that `make install' (would have) installed. uninstall: @for f in libhdf5.settings $(LIB); do \ @@ -123,17 +117,6 @@ uninstall: fi; \ done -## Removes those things that `make install-doc' (would have) installed. -uninstall-doc: - @for d in X $(SUBDIRS); do \ - if test $$d != X; then \ - (set -x; cd $$d && $(MAKE) $@) || exit 1; \ - fi; \ - done - @if test -n "$(PUB_DOCS)"; then \ - set -x; cd $(DOCDIR) && $(RM) $(PUB_DOCS); \ - fi - ## Removes temporary files without removing the final target files. That is, ## remove things like object files but not libraries or executables. ## diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index 129ac8a..0ced389 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -1,14 +1,18 @@ ## HDF5-C++ examples/Makefile(.in) ## -## Copyright (C) 2000 National Center for Supercomputing Applications. -## All rights reserved. +## Copyright (C) 2000, 2001 +## National Center for Supercomputing Applications +## All rights reserved. ## ## top_srcdir=@top_srcdir@/.. top_builddir=../.. srcdir=@srcdir@ + @COMMENCE@ +EXAMPLEDIR=$(docdir)/hdf5/examples/c++ + hdf5_srcdir=$(top_srcdir)/src hdf5_builddir=$(top_builddir)/src @@ -25,6 +29,9 @@ TEST_SRC=compound.cpp h5group.cpp create.cpp readdata.cpp chunks.cpp \ extend_ds.cpp writedata.cpp TEST_OBJ=$(TEST_SRC:.cpp=.lo) +H5_FILES=Attributes.h5 SDScompound.h5 Select.h5 SDSextendible.h5 Group.h5 SDS.h5 +EXAMPLE_PROGS=$(TEST_SRC) $(H5_FILES) + ## These are the programs that `make all' or `make tests' will build and which ## `make check' will run. List them in the order they should be run. TEST_PROGS=$(TEST_SRC:.cpp=) diff --git a/config/commence.in b/config/commence.in index b0b987c..878bd89 100644 --- a/config/commence.in +++ b/config/commence.in @@ -59,6 +59,7 @@ LT_UNINSTALL=$(LT) --mode=uninstall $(RM) ## defined. The main makefile is free to redefine these to something else. DOCDIR=$(docdir) SUBDOCDIR= +EXAMPLEDIR=$(docdir) LIB= LIB_SRC= LIB_OBJ= diff --git a/config/conclude.in b/config/conclude.in index c24a87e..07a9040 100644 --- a/config/conclude.in +++ b/config/conclude.in @@ -84,13 +84,19 @@ check test _test: tests ## Make installation directories directories if they don't exist. ## $(libdir): - mkdir $@ && chmod 755 $@ + $(top_srcdir)/bin/mkdirs $@ $(includedir): - mkdir $@ && chmod 755 $@ + $(top_srcdir)/bin/mkdirs $@ $(bindir): - mkdir $@ && chmod 755 $@ + $(top_srcdir)/bin/mkdirs $@ + +$(DOCDIR): + $(top_srcdir)/bin/mkdirs $@ + +$(EXAMPLEDIR): + $(top_srcdir)/bin/mkdirs $@ ## Install the library, the public header files, and public programs. ## @@ -124,9 +130,21 @@ install: $(PUB_LIB) $(PUB_HDR) $(PUB_PROGS) $(libdir) $(includedir) $(bindir) fi; \ done +install-examples: $(EXAMPLE_PROGS) $(EXAMPLEDIR) + @for f in X $(EXAMPLE_PROGS); do \ + if test $$f != X; then \ + (set -x; $(INSTALL_DATA) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1);\ + fi; \ + done + +uninstall-examples: + @if test -n "$(EXAMPLE_PROGS)"; then \ + set -x; cd $(EXAMPLEDIR) && $(RM) $(EXAMPLE_PROGS); \ + fi + ## Install the documents. ## -install-doc: $(PUB_DOCS) +install-doc: $(PUB_DOCS) $(DOCDIR) @if test -n "$(DOCDIR)"; then \ if test -d "$(DOCDIR)"; then \ :; \ diff --git a/configure b/configure index 6835260..0d6eba5 100755 --- a/configure +++ b/configure @@ -10316,14 +10316,6 @@ cat >> src/H5config.h <> src/H5config.h <