Add WAY_debug_t_NAME and WAY_debug_t_HC_OPTS
[ghc-hetmet.git] / mk / target.mk
index 0334896..32eb7e3 100644 (file)
@@ -1069,7 +1069,7 @@ endif
 # -------------------------------------------------------------------------
 # Rules to invoke the current target recursively for each way
 
-ifneq "$(WAYS)" ""
+ifneq "$(strip $(WAYS))" ""
 ifeq "$(way)" ""
 
 # NB: the targets exclude 
@@ -1081,7 +1081,7 @@ all docs TAGS clean distclean mostlyclean maintainer-clean install ::
        @echo "PWD = $(shell pwd)"
        @echo "------------------------------------------------------------------------"
 # Don't rely on -e working, instead we check exit return codes from sub-makes.
-       @case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
+       case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
        for i in $(WAYS) ; do \
          echo "------------------------------------------------------------------------"; \
          echo "== $(MAKE) way=$$i $@;"; \
@@ -1176,13 +1176,19 @@ $(ALL_TARGET) docs runtests $(BOOT_TARGET) TAGS clean distclean mostlyclean main
        @echo "------------------------------------------------------------------------"
 # Don't rely on -e working, instead we check exit return codes from sub-makes.
        @case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
+       if [ $$x_on_err -eq 0 ]; \
+           then echo "Won't exit on error due to MFLAGS: ${MFLAGS}"; \
+       fi; \
        for i in $(SUBDIRS); do \
          echo "------------------------------------------------------------------------"; \
          echo "== $(MAKE) $@ $(MFLAGS);"; \
          echo " in $(shell pwd)/$$i"; \
          echo "------------------------------------------------------------------------"; \
          $(MAKE) --no-print-directory -C $$i $(MFLAGS) $@; \
-         if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ;  then true; else exit 1; fi; \
+         if [ $$? -eq 0 -o $$x_on_err -eq 0 ]; \
+             then echo "Finished making $@ in $$i": $$?; \
+             else echo "Failed making $@ in $$i": $$?; exit 1; \
+         fi; \
        done
        @echo "------------------------------------------------------------------------"
        @echo "== Finished making \`$@' in $(SUBDIRS) ..."