# Generated automatically from Makefile.in by configure.
# HDF5 Library Makefile(.in)
#
# Copyright (C) 1997 National Center for Supercomputing Applications.
#                    All rights reserved.
#
# 
top_srcdir=../../..
top_builddir=../../..
srcdir=.
VPATH=.:.

#------------------------------------------------------------- -*- makefile -*-
# The following section of this makefile comes from the
# `./config/commence' file which was generated with config.status
# from `./config/commence.in'.
#------------------------------------------------------------------------------

# Things that Make needs
.SUFFIXES:
.SUFFIXES: .c .o .lo


# Programs
SHELL=/bin/sh
CC=gcc
CFLAGS=-g -O2 -Wall -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -O
CPPFLAGS=  -DNDEBUG -UH5_DEBUG_API
LDFLAGS=
LIBS=-lz -lnsl -lm 
AR=ar
RANLIB=ranlib
RM=rm -f
CP=cp
INSTALL=/usr/bin/install -c
INSTALL_PROGRAM=${INSTALL}
INSTALL_DATA=${INSTALL} -m 644
RUNSERIAL=
RUNPARALLEL=
RUNTEST=$(RUNSERIAL)
TRACE=:

# Installation points
prefix=/usr
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
libdir=${exec_prefix}/lib
includedir=${prefix}/include
docdir=${prefix}/doc
PUB_LIB=$(LIB)

# Shared libraries
LT=$(top_builddir)/libtool
LT_COMPILE=$(LT) --mode=compile $(CC)
LT_LINK_LIB=$(LT) --mode=link $(CC) -rpath $(libdir)
LT_LINK_EXE=$(LT) --mode=link $(CC) -rpath $(bindir)
LT_RUN=$(LT) --mode=execute
LT_INSTALL_PROG=$(LT) --mode=install $(INSTALL_PROGRAM)
LT_INSTALL_LIB=$(LT) --mode=install $(INSTALL_DATA)
LT_UNINSTALL=$(LT) --mode=uninstall $(RM)

## Optional variables. We must declare them here because Irix pmake
## 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)

# The default is to build the library and/or programs.  We must build
# them sequentially.
all:
	$(MAKE) lib
	$(MAKE) progs
	$(MAKE) tests

# The following rules insure that the Makefile is up-to-date by rerunning
# various autoconf components (although not all versions of make assume
# that the makefile is implicitly a target).  We use time stamp files to
# keep track of the most recent update of H5config.h.in and H5config.h
# because autoheader and config.status don't update the modification time
# if the contents don't change.
#
# Graphically, the dependencies are:
#
#		         configure.in
#                           |  |
#         +-----------------+  +------------+
#         |                                 |
#      stamp1                           configure
#   (H5config.h.in)                         |
#       |  |                                |
#       |  +---------------+    +-----------+
#       |                  |    |
#       |               config.status
#       |                     |
#       |  +------------------+
#       |  |
#      stamp2
#    (H5config.h)                   Makefile.in et al
#         |                                 |
#         +------------------+  +-----------+
#                            |  |
#                          Makefile
#
# A side effect of updating stamp1 is to generate H5config.h.in and a
# side effect of updating stamp2 is to generate H5config.h.  When using
# a version of make that doesn't treat the makefile as the initial target
# the user may want to occassionally type `make Makefile' in any source
# directory.
#
STAMP1=$(top_builddir)/config/stamp1
STAMP2=$(top_builddir)/config/stamp2

MAKEFILE_PARTS=$(srcdir)/Makefile.in					      \
	       $(top_srcdir)/config/commence.in				      \
	       $(top_srcdir)/config/conclude.in				      \
	       $(top_srcdir)/config/depend.in

$(STAMP1): $(top_srcdir)/configure.in
	touch $(STAMP1)
	-cd $(top_srcdir); autoheader

$(STAMP2): $(STAMP1) $(top_builddir)/config.status
	touch $(STAMP2)
	-cd $(top_builddir); \
	   CONFIG_FILES= CONFIG_HEADERS=src/H5config.h ./config.status

$(top_srcdir)/configure: $(top_srcdir)/configure.in
	-cd $(top_srcdir); autoconf

$(top_builddir)/config.status: $(top_srcdir)/configure $(STAMP1)
	-cd $(top_builddir); ./config.status --recheck

Makefile: $(MAKEFILE_PARTS) $(STAMP2)
	-cd $(top_builddir); CONFIG_HEADERS= ./config.status

#------------------------------------------------------------------------------
# The following section of this makefile comes from the middle of `Makefile.in'
# from this directory.  It was generated by running `config.status'.
#------------------------------------------------------------------------------

# Subdirectories in build-order (not including `examples')
SUBDIRS=
DOCDIR=$(docdir)/hdf5/Tutor

TRACE=perl $(top_srcdir)/bin/trace

# Add `-I.' to the C preprocessor flags.
CPPFLAGS=-I. -I.   -DNDEBUG -UH5_DEBUG_API

# Temporary files
MOSTLYCLEAN=

# Public doc files (to be installed)...
PUB_DOCS= Contents.html ContentsAdd.html ContentsAdv.html \
    ContentsFull.html ContentsIntro.html Copyright.html \
    answers.html api.html bighdf2sp.JPG compound.html \
    crtatt.html crtdat.html crtfile.html crtgrp.html \
    crtgrpar.html crtgrpd.html extend.html \
    fileorg.html glossary.html img001.gif img002.gif \
    img003.gif img004.gif img005.gif index.html intro.html \
    iterate.html iterator.txt mount.html questions.html \
    rdwt.html references.html reftoobj.html reftoreg.html \
    select.html selectc.html title.html util.html

# Other doc files (not to be installed)...
PRIVATE_DOCS=


#------------------------------------------------------------- -*- makefile -*-
# The following section of this makefile comes from the
# `./config/conclude' file which was generated with config.status
# from `./config/conclude.in'.
#------------------------------------------------------------------------------

# This is the target for the library described in the main body of the
# makefile.
#
lib: $(LIB)
$(LIB) __no_library__: $(LIB_OBJ)
	@$(LT_LINK_LIB) -o $@ $(CFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS)

progs: $(LIB) $(PROGS)

# Build a tags file in this directory.
TAGS: $(LIB_SRC)
	$(RM) $@
	-etags $(LIB_SRC)

# Runs each test in order, passing $(TEST_FLAGS) to the program.
tests: $(TEST_PROGS) $(LIB)
check test _test: tests
	@for test in $(TEST_PROGS) dummy; do                                  \
	   if test $$test != dummy; then				      \
	      echo "============================";			      \
	      echo "Testing $$test $(TEST_FLAGS)";			      \
	      echo "============================";			      \
	      PATH=".:$$PATH" srcdir=$(srcdir)				      \
		 $(RUNTEST) $$test $(TEST_FLAGS) ||			      \
		 exit 1;						      \
	      echo "";							      \
	   fi;								      \
	done;
	@for test in $(TEST_SCRIPTS) dummy; do                                \
	   if test $$test != dummy; then				      \
	      echo "============================";			      \
	      echo "Testing $$test $(TEST_FLAGS)";			      \
	      echo "============================";			      \
	      RUNSERIAL="$(RUNSERIAL)" RUNPARALLEL="$(RUNPARALLEL)"           \
	      srcdir=$(srcdir)						      \
		 /bin/sh $$test $(TEST_FLAGS) ||		              \
		 exit 1;						      \
	      echo "";							      \
	   fi;								      \
	done;

# Make installation directories directories if they don't exist.
$(libdir):
	mkdir $@ && chmod 755 $@

$(includedir):
	mkdir $@ && chmod 755 $@

$(bindir):
	mkdir $@ && chmod 755 $@

$(DOCDIR):
	mkdir $@ && chmod 755 $@

# Install the library, the public header files, and programs.
install: $(PUB_LIB) $(PUB_HDR) $(PROGS) $(libdir) $(includedir) $(bindir)
	@for f in X $(PUB_LIB); do					      \
	   if test $$f != X; then					      \
	      ($(LT_INSTALL_LIB) $$f $(libdir)/. || exit 1);		      \
	   fi;								      \
	done
	@if test -f libhdf5.settings; then				      \
	   (set -x; $(INSTALL_DATA) libhdf5.settings $(libdir)/. || exit 1);  \
	fi
	@for f in X $(PUB_HDR); do					      \
	   if test $$f != X; then					      \
	      if test -f $$f; then					      \
		 (set -x; $(INSTALL_DATA) $$f $(includedir)/. || exit 1);     \
	      else							      \
	         (set -x; $(INSTALL_DATA) $(srcdir)/$$f $(includedir)/. ||    \
		    exit 1);						      \
	      fi;							      \
	   fi;								      \
	done
	@for f in X $(PROGS); do					      \
	   if test $$f != X; then					      \
	     ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1);		      \
	   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;								      \
	done

# Removes those things that `make install' (would have) installed.
uninstall:
	@if test "X$(LIB)" != X; then					      \
	   for f in $(LIB); do						      \
	      $(LT_UNINSTALL) $(libdir)/$$f;				      \
	   done;							      \
	fi
	@if test "X$(PUB_HDR)" != X; then				      \
	   set -x; cd $(includedir) && $(RM) $(PUB_HDR);		      \
	fi
	@if test "X$(PROGS)" != X; then					      \
	   for f in $(PROGS); do					      \
	      $(LT_UNINSTALL) $(bindir)/$$f;				      \
	   done;							      \
	fi

# 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 "X$(PUB_DOCS)" != X; 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.
#
mostlyclean:
	-$(RM) $(LIB_OBJ) $(LIB_OBJ:.lo=.o)
	-$(RM) $(TEST_OBJ) $(TEST_OBJ:.lo=.o)
	-$(RM) $(PROG_OBJ) $(PROG_OBJ:.lo=.o) $(MOSTLYCLEAN)

# Like `mostlyclean' except it also removes the final targets: things like
# libraries and executables.  This target doesn't remove any file that
# is part of the HDF5 distribution.
#
clean: mostlyclean
	-$(RM) $(LIB) $(TEST_PROGS) $(PROGS) $(CLEAN)
	-$(RM) -r .libs

# Like `clean' except it also removes files that were created by running
# configure.  If you've unpacked the source and built HDF5 without creating
# any other files, then `make distclean' will leave only the files that were
# in the distribution.
#
distclean: clean
	-$(RM) .depend TAGS *~ core *.core *.bak *.old *.new $(DISTCLEAN)
	@if test -f $(srcdir)/Makefile.in; then				      \
	   (set -x; $(RM) Makefile);					      \
	fi


# Like `distclean' except it deletes all files that can be regenerated from
# the makefile, including those generated from autoheader and autoconf.
#
maintainer-clean: distclean
	-$(RM) *~ core core.* *.core *.bak *.contrib gmon.out

# Implicit rules
.c.o:
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $<

.c.lo:
	@$(LT_COMPILE) $(CFLAGS) $(CPPFLAGS) -c $<

#------------------------------------------------------------------------------
# The following section of this makefile contains dependencies between the
# source files and the header files.  If GNU make and GCC are being used then
# the dependencies are in the form of rules that cause the information to
# be kept updated automatically.  Otherwise the dependencies are listed
# explicitly and come from the `.distdep' files in the various directories.
# These files are part of the distribution and are generated automatically on
# GNU/GCC systems.
#------------------------------------------------------------------------------


#                                                              -*- makefile -*-

# We keep a list of dependencies in `.depend' for each of the source
# files on which it depends.  When one of the source files is modified
# we remove its record from .depend and regenerate its dependencies,
# tacking them onto the end of .depend.  By including the .depend file
# into the makefile, we're telling make that the makefile depends on
# the dependency list in the .depend file.
#
# This is as fast as the `.d' method described in the GNU make manual
# for automatic dependencies, but has the added advantage that all
# dependencies are stored in one place.  The advantage over the
# `makedepend' program is that only those files that are out of date
# have dependency information rebuilt, and the Makefile is not
# modified.
#
# This is also where tracing information is updated.  The $(TRACE)
# program is run on each source file to make sure that the H5TRACE()
# macros are up to date.  If they are then the file is not modified,
# otherwise the file is changed and a backup is saved by appending a
# tilde to the file name.
#
.PRECIOUS: .depend .distdep
dep depend: .distdep

.distdep: .depend
	touch .distdep
	-srcdir=$(srcdir) perl -p $(top_srcdir)/bin/distdep .depend >.distdep

.depend: $(LIB_SRC) $(TEST_SRC) $(PROG_SRC)
	@touch .depend
	@for dep in $? dummy; do					      \
	   if [ $$dep != "dummy" ]; then				      \
	      echo Building dependencies for $$dep;			      \
	      obj=`echo $$dep | sed 's/\.c/\\\\.lo/'`;			      \
	      sed '\%$$obj%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@;		      \
	      $(TRACE) $$dep;						      \
	      $(CC) -M -MG $(CPPFLAGS) $$dep |sed 's/\.o/.lo/' >>$@;	      \
	   fi;								      \
	done;
	-perl -p $(top_srcdir)/bin/distdep .depend >$(srcdir)/.distdep

-include .depend




