From ac687db0208cac1007c4ac97f78802b3b4a609c6 Mon Sep 17 00:00:00 2001
From: Scot Breitenfeld <brtnfld@hdfgroup.org>
Date: Fri, 23 May 2008 12:08:30 -0500
Subject: [svn-r15069] Purpose: Added code to remove module files when make
 clean

Description:
The module files were not being removed when make clean
and caused compiling errors. fixed.
---
 fortran/test/Makefile.am | 25 ++++++++++++++++++++
 fortran/test/Makefile.in | 60 +++++++++++++++++++++++++++++++++++-------------
 2 files changed, 69 insertions(+), 16 deletions(-)

diff --git a/fortran/test/Makefile.am b/fortran/test/Makefile.am
index 4aa62cf..eeafeea 100644
--- a/fortran/test/Makefile.am
+++ b/fortran/test/Makefile.am
@@ -63,6 +63,30 @@ LDADD=libh5test_fortran.la $(LIBH5TEST) $(LIBH5F) $(LIBHDF5)
 CHECK_CLEANFILES+=*.h5
 MOSTLYCLEANFILES=*.tmp
 
+# Fortran module files can have different extensions and different names
+# (e.g., different capitalizations) on different platforms.  Write rules
+# for them explicitly rather than trying to teach automake about them.
+# They should be installed as headers and removed during clean.
+maintainer-clean-local: clean-local
+distclean-local: clean-local
+clean-local:
+	@if test -n "$(F9XMODEXT)" && test "X$(F9XMODEXT)" != "Xo"; then \
+	  $(RM) *.$(F9XMODEXT);                                         \
+	fi
+
+install-data-local:
+	@if test -n "$(F9XMODEXT)" && test "X$(F9XMODEXT)" != "Xo"; then \
+	  $(CP) $(top_builddir)/$(subdir)/*.$(F9XMODEXT) $(includedir)/. ; \
+	fi
+
+uninstall-local:
+	@if test -n "$(F9XMODEXT)" -a "X$(F9XMODEXT)" != "Xo"; then      \
+	  if test -f "$(includedir)/tf.$(F9XMODEXT)" -o -f "$(includedir)/TF.$(F9XMODEXT)"; then \
+	    set -x; $(RM) $(includedir)/*.$(F9XMODEXT);                 \
+	  fi;                                                           \
+	fi;								\
+	$(RM) $(bindir)/$(H5FC_NAME)
+
 # Mark this directory as part of the Fortran API (this affects output
 # from tests in conclude.am)
 FORTRAN_API=yes
@@ -78,5 +102,6 @@ fortranlib_test.lo:             $(srcdir)/fortranlib_test.f90 tf.lo
 fortranlib_test_1_8.lo:         $(srcdir)/fortranlib_test_1_8.f90 tf.lo
 tH5A_1_8.lo:                    $(srcdir)/tH5A_1_8.f90 tf.lo
 tH5G_1_8.lo:                    $(srcdir)/tH5G_1_8.f90 tf.lo
+tf.lo:                          $(srcdir)/t.f90
 
 include $(top_srcdir)/config/conclude.am
diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in
index 0a63845..861e691 100644
--- a/fortran/test/Makefile.in
+++ b/fortran/test/Makefile.in
@@ -731,14 +731,14 @@ maintainer-clean-generic:
 	@echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool clean-local \
 	clean-noinstLTLIBRARIES mostlyclean-am
 
 distclean: distclean-am
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
+	distclean-local distclean-tags
 
 dvi: dvi-am
 
@@ -750,7 +750,7 @@ info: info-am
 
 info-am:
 
-install-data-am:
+install-data-am: install-data-local
 
 install-dvi: install-dvi-am
 
@@ -771,7 +771,8 @@ installcheck-am:
 maintainer-clean: maintainer-clean-am
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
+maintainer-clean-am: distclean-am maintainer-clean-generic \
+	maintainer-clean-local
 
 mostlyclean: mostlyclean-am
 
@@ -786,23 +787,25 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am:
+uninstall-am: uninstall-local
 
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am all-local check check-TESTS check-am \
 	clean clean-checkPROGRAMS clean-generic clean-libtool \
-	clean-noinstLTLIBRARIES ctags distclean distclean-compile \
-	distclean-generic distclean-libtool distclean-tags distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \
-	pdf-am ps ps-am tags uninstall uninstall-am
+	clean-local clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-local distclean-tags distdir dvi dvi-am html html-am \
+	info info-am install install-am install-data install-data-am \
+	install-data-local install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic maintainer-clean-local mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-local pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-local
 
 
 # List all build rules defined by HDF5 Makefiles as "PHONY" targets here.
@@ -816,6 +819,30 @@ uninstall-am:
 help:
 	@$(top_srcdir)/bin/makehelp
 
+# Fortran module files can have different extensions and different names
+# (e.g., different capitalizations) on different platforms.  Write rules
+# for them explicitly rather than trying to teach automake about them.
+# They should be installed as headers and removed during clean.
+maintainer-clean-local: clean-local
+distclean-local: clean-local
+clean-local:
+	@if test -n "$(F9XMODEXT)" && test "X$(F9XMODEXT)" != "Xo"; then \
+	  $(RM) *.$(F9XMODEXT);                                         \
+	fi
+
+install-data-local:
+	@if test -n "$(F9XMODEXT)" && test "X$(F9XMODEXT)" != "Xo"; then \
+	  $(CP) $(top_builddir)/$(subdir)/*.$(F9XMODEXT) $(includedir)/. ; \
+	fi
+
+uninstall-local:
+	@if test -n "$(F9XMODEXT)" -a "X$(F9XMODEXT)" != "Xo"; then      \
+	  if test -f "$(includedir)/tf.$(F9XMODEXT)" -o -f "$(includedir)/TF.$(F9XMODEXT)"; then \
+	    set -x; $(RM) $(includedir)/*.$(F9XMODEXT);                 \
+	  fi;                                                           \
+	fi;								\
+	$(RM) $(bindir)/$(H5FC_NAME)
+
 # fflush2 depends on files created by fflush1
 fflush2.chkexe_: fflush1.chkexe_
 
@@ -827,6 +854,7 @@ fortranlib_test.lo:             $(srcdir)/fortranlib_test.f90 tf.lo
 fortranlib_test_1_8.lo:         $(srcdir)/fortranlib_test_1_8.f90 tf.lo
 tH5A_1_8.lo:                    $(srcdir)/tH5A_1_8.f90 tf.lo
 tH5G_1_8.lo:                    $(srcdir)/tH5G_1_8.f90 tf.lo
+tf.lo:                          $(srcdir)/t.f90
 
 # lib/progs/tests targets recurse into subdirectories. build-* targets
 # build files in this directory.
-- 
cgit v0.12