Tweak to the directory-building rule
[ghc-hetmet.git] / ghc.mk
diff --git a/ghc.mk b/ghc.mk
index 23d4e5f..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)" $@
 
 # -----------------------------------------------------------------------------
@@ -817,6 +821,8 @@ ifneq "$(INSTALL_LIBRARY_DOCS)" ""
        for i in $(INSTALL_LIBRARY_DOCS); do \
                $(INSTALL_DOC) $(INSTALL_OPTS) $$i "$(DESTDIR)$(docdir)/html/libraries/"; \
        done
+       $(INSTALL_DATA) $(INSTALL_OPTS) libraries/prologue.txt "$(DESTDIR)$(docdir)/html/libraries/"
+       $(INSTALL_SCRIPT) $(INSTALL_OPTS) libraries/gen_contents_index "$(DESTDIR)$(docdir)/html/libraries/"
 endif
 ifneq "$(INSTALL_HTML_DOC_DIRS)" ""
        for i in $(INSTALL_HTML_DOC_DIRS); do \
@@ -917,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
@@ -1056,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
 
 # -----------------------------------------------------------------------------