From 6f63dd75e3e412aa4deec1569cefb12782c2c675 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 16 Apr 2001 18:15:36 -0500 Subject: [svn-r3814] Purpose: Cleanup Description: If there isn't anything to "remove" during the cleanup faze. This stops the "make clean"s from printing out: rm -f all of the time. Solution: Check if hte macros have anything in them before calling the rm. Platforms tested: Linux --- c++/config/conclude.in | 21 ++++++++++++++------- fortran/config/conclude.in | 21 ++++++++++++++------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/c++/config/conclude.in b/c++/config/conclude.in index 997ae26..c024c32 100644 --- a/c++/config/conclude.in +++ b/c++/config/conclude.in @@ -114,7 +114,7 @@ uninstall: @for f in libhdf5.settings $(LIB); do \ $(LT_UNINSTALL) $(libdir)/$$f; \ done - @if test "X$(PUB_HDR)" != X; then \ + @if test -n "$(PUB_HDR)"; then \ set -x; cd $(includedir) && $(RM) $(PUB_HDR); \ fi @for f in X $(PUB_PROGS); do \ @@ -130,7 +130,7 @@ uninstall-doc: (set -x; cd $$d && $(MAKE) $@) || exit 1; \ fi; \ done - @if test "X$(PUB_DOCS)" != X; then \ + @if test -n "$(PUB_DOCS)"; then \ set -x; cd $(DOCDIR) && $(RM) $(PUB_DOCS); \ fi @@ -138,16 +138,24 @@ uninstall-doc: ## 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) + @if test -n "$(LIB_OBJ)"; then \ + -$(RM) $(LIB_OBJ) $(LIB_OBJ:.lo=.o); \ + fi + @if test -n "$(TEST_OBJ)"; then \ + -$(RM) $(TEST_OBJ) $(TEST_OBJ:.lo=.o); \ + fi + @if test -n "$(PROG_OBJ)" -o -n "$(MOSTLYCLEAN)"; then \ + -$(RM) $(PROG_OBJ) $(PROG_OBJ:.lo=.o) $(MOSTLYCLEAN); \ + fi ## 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) + @if test -n "$(LIB)" -o -n "$(TEST_PROGS)" -o -n "$(PROGS)" -o -n "$(CLEAN)"; then \ + -$(RM) $(LIB) $(TEST_PROGS) $(PROGS) $(CLEAN); \ + fi -$(RM) -r .libs ## Like `clean' except it also removes files that were created by running @@ -161,7 +169,6 @@ distclean: clean (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. ## diff --git a/fortran/config/conclude.in b/fortran/config/conclude.in index fbb7717..39eb43e 100644 --- a/fortran/config/conclude.in +++ b/fortran/config/conclude.in @@ -113,7 +113,7 @@ uninstall: @for f in libhdf5.settings $(LIB); do \ $(LT_UNINSTALL) $(libdir)/$$f; \ done - @if test "X$(PUB_HDR)" != X; then \ + @if test -n "$(PUB_HDR)"; then \ set -x; cd $(includedir) && $(RM) $(PUB_HDR); \ fi @for f in X $(PUB_PROGS); do \ @@ -129,7 +129,7 @@ uninstall-doc: (set -x; cd $$d && $(MAKE) $@) || exit 1; \ fi; \ done - @if test "X$(PUB_DOCS)" != X; then \ + @if test -n "$(PUB_DOCS)"; then \ set -x; cd $(DOCDIR) && $(RM) $(PUB_DOCS); \ fi @@ -137,16 +137,24 @@ uninstall-doc: ## 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) + @if test -n "$(LIB_OBJ)"; then \ + -$(RM) $(LIB_OBJ) $(LIB_OBJ:.lo=.o); \ + fi + @if test -n "$(TEST_OBJ)"; then \ + -$(RM) $(TEST_OBJ) $(TEST_OBJ:.lo=.o); \ + fi + @if test -n "$(PROG_OBJ)" || test -n "$(MOSTLYCLEAN)"; then \ + -$(RM) $(PROG_OBJ) $(PROG_OBJ:.lo=.o) $(MOSTLYCLEAN); \ + fi ## 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) + @if test -n "$(LIB)" -o -n "$(TEST_PROGS)" -o -n "$(PROGS)" -o -n "$(CLEAN)"; then \ + -$(RM) $(LIB) $(TEST_PROGS) $(PROGS) $(CLEAN); \ + fi -$(RM) *.M *.a *.mod -$(RM) -r .libs @@ -161,7 +169,6 @@ distclean: clean (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. ## -- cgit v0.12