Tweak to the directory-building rule
[ghc-hetmet.git] / ghc.mk
diff --git a/ghc.mk b/ghc.mk
index 015e3b4..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)" $@
 
 # -----------------------------------------------------------------------------
@@ -919,6 +923,8 @@ $(eval $(call bindist,.,\
        mk/project.mk \
        mk/install.mk.in \
        bindist.mk \
+       libraries/gen_contents_index \
+       libraries/prologue.txt \
        libraries/dph/LICENSE \
  ))
 endif
@@ -1058,7 +1064,13 @@ publish-sdist :
 endif
 
 ifeq "$(BootingFromHc)" "YES"
-SRC_CC_OPTS += -DNO_REGS -DUSE_MINIINTERPRETER -D__GLASGOW_HASKELL__=$(ProjectVersionInt)
+# In a normal build we use GHC to compile C files (see
+# rules/c-suffix-rules.mk), which passes a number of its own options
+# to the C compiler.  So when bootstrapping we have to provide these
+# flags explicitly to C compilations.
+SRC_CC_OPTS += -DNO_REGS -DUSE_MINIINTERPRETER
+SRC_CC_OPTS += -D__GLASGOW_HASKELL__=$(ProjectVersionInt)
+SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR)
 endif
 
 # -----------------------------------------------------------------------------