[project @ 1997-12-16 11:01:13 by simonm]
[ghc-hetmet.git] / mk / target.mk
index d325755..02be747 100644 (file)
@@ -479,10 +479,10 @@ ifneq "$(BIN_DIST)" "1"
        @for i in $(INSTALL_SCRIPTS); do \
           $(RM) $$i.tmp; \
           echo "#! $(PERL)" > $$i.tmp ; \
-          echo $$"bindir='$(bindir)';"                            >> $$i.tmp ; \
-          echo $$"libdir='$(libdir)';"                            >> $$i.tmp ; \
-          echo $$"libexecdir='$(libexecdir)';"                    >> $$i.tmp ; \
-          echo $$"datadir='$(datadir)';"                          >> $$i.tmp ; \
+          echo '$$'"bindir='$(bindir)';"                            >> $$i.tmp ; \
+          echo '$$'"libdir='$(libdir)';"                            >> $$i.tmp ; \
+          echo '$$'"libexecdir='$(libexecdir)';"                    >> $$i.tmp ; \
+          echo '$$'"datadir='$(datadir)';"                          >> $$i.tmp ; \
           cat  $$i                                                >> $$i.tmp ; \
           echo $(INSTALL_PROGRAM) $(filter-out -s,$(INSTALL_OPTS)) $$i.tmp $(bindir)/$$i ;    \
           $(INSTALL_PROGRAM) $(filter-out -s,$(INSTALL_BIN_OPTS)) $$i.tmp $(bindir)/$$i ; \
@@ -508,10 +508,10 @@ ifneq "$(BIN_DIST)" "1"
        @for i in $(INSTALL_LIB_SCRIPTS); do \
           $(RM) $$i.tmp; \
           echo "#! $(PERL)" > $$i.tmp ; \
-          echo $$"bindir='$(bindir)';"                            >> $$i.tmp ; \
-          echo $$"libdir='$(libdir)';"                            >> $$i.tmp ; \
-          echo $$"libexecdir='$(libexecdir)';"                    >> $$i.tmp ; \
-          echo $$"datadir='$(datadir)';"                          >> $$i.tmp ; \
+          echo '$$'"bindir='$(bindir)';"                            >> $$i.tmp ; \
+          echo '$$'"libdir='$(libdir)';"                            >> $$i.tmp ; \
+          echo '$$'"libexecdir='$(libexecdir)';"                    >> $$i.tmp ; \
+          echo '$$'"datadir='$(datadir)';"                          >> $$i.tmp ; \
           cat  $$i                                                >> $$i.tmp ; \
           echo $(INSTALL_PROGRAM) $(INSTALL_OPTS) $$i $(libdir) ;    \
           $(INSTALL_PROGRAM) $(INSTALL_OPTS) $$i.tmp $(libdir)/$$i ; \
@@ -537,10 +537,10 @@ ifneq "$(BIN_DIST)" "1"
        @for i in $(INSTALL_LIBEXEC_SCRIPTS); do \
           $(RM) $$i.tmp; \
           echo "#! $(PERL)" > $$i.tmp ; \
-          echo $$"bindir='$(bindir)';"                            >> $$i.tmp ; \
-          echo $$"libdir='$(libdir)';"                            >> $$i.tmp ; \
-          echo $$"libexecdir='$(libexecdir)';"                    >> $$i.tmp ; \
-          echo $$"datadir='$(datadir)';"                          >> $$i.tmp ; \
+          echo '$$'"bindir='$(bindir)';"                            >> $$i.tmp ; \
+          echo '$$'"libdir='$(libdir)';"                            >> $$i.tmp ; \
+          echo '$$'"libexecdir='$(libexecdir)';"                    >> $$i.tmp ; \
+          echo '$$'"datadir='$(datadir)';"                          >> $$i.tmp ; \
           cat  $$i                                                >> $$i.tmp ; \
           echo $(INSTALL_PROGRAM) $(INSTALL_OPTS) $$i $(libexecdir) ;    \
           $(INSTALL_PROGRAM) $(INSTALL_OPTS) $$i.tmp $(libexecdir)/$$i ; \
@@ -676,7 +676,7 @@ dist-pre::
        -rm -rf $(SRC_DIST_DIR)
        -rm -f $(SRC_DIST_NAME).tar.gz
        (cd $(FPTOOLS_TOP_ABS); find $(SRC_DIST_DIRS) -type d \( -name CVS -prune -o -name SRC -prune -o -name tests -prune -o -exec $(MKDIRHIER) $(SRC_DIST_DIR)/{} \; \) ; )
-       (cd $(FPTOOLS_TOP_ABS); find $(SRC_DIST_DIRS) -name CVS -prune -o -name SRC -prune -o -name tests -prune -o -name "*~" -prune -o -name ".cvsignore" -prune -o -type l -exec $(LN_S) $(FPTOOLS_TOP_ABS)/{} $(SRC_DIST_DIR)/{} \; )
+       (cd $(FPTOOLS_TOP_ABS); find $(SRC_DIST_DIRS) -name CVS -prune -o -name SRC -prune -o -name tests -prune -o -name "*~" -prune -o -name ".cvsignore" -prune -o -name "\#*" -prune -o -name ".\#*" -prune -o -type l -exec $(LN_S) $(FPTOOLS_TOP_ABS)/{} $(SRC_DIST_DIR)/{} \; )
 
 #
 # After having created a shadow distribution tree and copied/linked
@@ -1004,6 +1004,18 @@ endif    # if way
 
 # No ways, so iterate over the SUBDIRS
 
+# note about recursively invoking make: we'd like make to drop all the
+# way back to the top level if it fails in any of the
+# sub(sub-...)directories.  This is done by setting the -e flag to the
+# shell during the loop, which causes an immediate failure if any of
+# the shell commands fail.
+
+# One exception: if the user gave the -i or -k flag to make in the
+# first place, we'd like to reverse this behaviour.  So we check for
+# these flags, and set the -e flag appropriately.  NOTE: watch out for
+# the --no-print-directory flag which is passed to recursive
+# invocations of make.
+
 ifeq "$(way)" ""
 ifneq "$(SUBDIRS)" ""
 
@@ -1012,8 +1024,8 @@ all docs runtests boot TAGS clean veryclean maintainer-clean install info ::
        @echo "===fptools== Recursively making \`$@' in $(SUBDIRS) ..."
        @echo "PWD = $(shell pwd)"
        @echo "------------------------------------------------------------------------"
-       @case '${MFLAGS}' in -*[ik]*) set -e;; *) set +e;; esac
-       @for i in $(SUBDIRS) ; do \
+       @case '${MFLAGS}' in *-[ik]*) set +e;; *) set -e;; esac; \
+       for i in $(SUBDIRS) ; do \
          echo "------------------------------------------------------------------------"; \
          echo "==fptools== $(MAKE) $@;"; \
          echo " in $(shell pwd)/$$i"; \
@@ -1026,7 +1038,7 @@ all docs runtests boot TAGS clean veryclean maintainer-clean install info ::
        @echo "------------------------------------------------------------------------"
 
 dist ::
-       @case '${MFLAGS}' in -*[ik]*) set -e;; *) set +e;; esac
+       @case '${MFLAGS}' in *-[ik]*) set +e;; *) set -e;; esac; \
        for i in $(SUBDIRS) ; do \
          $(MKDIRHIER_PREFIX)mkdirhier $(SRC_DIST_DIR)/$$i; \
          $(MAKE) -C $$i $(MFLAGS) $@ SRC_DIST_DIR=$(SRC_DIST_DIR)/$$i; \
@@ -1054,8 +1066,8 @@ all docs runtests TAGS clean veryclean maintainer-clean install ::
        @echo "===fptools== Recursively making \`$@' for ways: $(WAYS) ..."
        @echo "PWD = $(shell pwd)"
        @echo "------------------------------------------------------------------------"
-       @case '${MFLAGS}' in -*[ik]*) set -e;; *) set +e;; esac
-       @for i in $(WAYS) ; do \
+       @case '${MFLAGS}' in *-[ik]*) set +e;; *) set -e;; esac; \
+       for i in $(WAYS) ; do \
          echo "------------------------------------------------------------------------"; \
          echo "==fptools== $(MAKE) way=$$i $@;"; \
          echo "PWD = $(shell pwd)"; \