Tweak to the directory-building rule
authorSimon Marlow <marlowsd@gmail.com>
Fri, 13 Nov 2009 12:57:19 +0000 (12:57 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Fri, 13 Nov 2009 12:57:19 +0000 (12:57 +0000)
So we don't try to recreate directories just because they are older
than mkdirhier, since mkdirhier won't touch them.

ghc.mk

diff --git a/ghc.mk b/ghc.mk
index 755b9ae..26dc314 100644 (file)
--- a/ghc.mk
+++ b/ghc.mk
@@ -411,7 +411,11 @@ endif
 # Don't try to delete directories:
 .PRECIOUS: %/.
 
-%/. : $(MKDIRHIER)
+# Create build directories on demand.  NB. the | below: this indicates
+# that $(MKDIRHIER) is an order-only dependency, which means that this
+# rule fires after building mkdirhier, but we won't try to recreate
+# directories if mkdirhier changes.
+%/. : | $(MKDIRHIER)
        "$(MKDIRHIER)" $@
 
 # -----------------------------------------------------------------------------