Add the include files to bindists
[ghc-hetmet.git] / ghc.mk
diff --git a/ghc.mk b/ghc.mk
index 8f2737d..374bd53 100644 (file)
--- a/ghc.mk
+++ b/ghc.mk
@@ -39,8 +39,6 @@
 #
 #   * per-source-file dependencies instead of one .depend file?
 #   * eliminate undefined variables, and use --warn-undefined-variables?
-#   * perhaps we should make all the output dirs in the .depend rule, to
-#     avoid all these mkdirhier calls?
 #   * put outputs from different ways in different subdirs of distdir/build,
 #     then we don't have to use -osuf/-hisuf.  We would have to install
 #     them in different places too, so we'd need ghc-pkg support for packages
@@ -405,6 +403,9 @@ endif
 # -----------------------------------------------------------------------------
 # Directories
 
+# Don't try to delete directories:
+.PRECIOUS: %/.
+
 %/. : $(MKDIRHIER)
        "$(MKDIRHIER)" $@
 
@@ -864,6 +865,7 @@ $(eval $(call bindist,.,\
        $(BINDIST_EXTRAS) \
        $(includes_H_CONFIG) \
        $(includes_H_PLATFORM) \
+    $(includes_H_FILES) \
        includes/ghcconfig.h \
        includes/rts/Config.h \
     $(INSTALL_HEADERS) \
@@ -892,8 +894,8 @@ endif
 BIN_DIST_MK = $(BIN_DIST_PREP_DIR)/bindist.mk
 
 unix-binary-dist-prep:
-       "$(RM)" $(RM_OPTS) -r bindistprep/*
-       mkdir $(BIN_DIST_PREP_DIR)
+       "$(RM)" $(RM_OPTS) -r bindistprep/
+       "$(MKDIRHIER)" $(BIN_DIST_PREP_DIR)
        set -e; for i in LICENSE compiler ghc rts libraries utils docs libffi includes driver mk rules Makefile aclocal.m4 config.sub config.guess install-sh extra-gcc-opts.in ghc.mk inplace; do ln -s ../../$$i $(BIN_DIST_PREP_DIR)/; done
        echo "HADDOCK_DOCS       = $(HADDOCK_DOCS)"       >> $(BIN_DIST_MK)
        echo "LATEX_DOCS         = $(LATEX_DOCS)"         >> $(BIN_DIST_MK)
@@ -908,12 +910,12 @@ unix-binary-dist-prep:
        cd bindistprep && "$(TAR)" hcf - -T ../$(BIN_DIST_LIST) | bzip2 -c > ../$(BIN_DIST_PREP_TAR_BZ2)
 
 windows-binary-dist-prep:
-       "$(RM)" $(RM_OPTS) -r bindistprep/*
+       "$(RM)" $(RM_OPTS) -r bindistprep/
        $(MAKE) prefix=$(TOP)/$(BIN_DIST_PREP_DIR) install
        cd bindistprep && "$(TAR)" cf - $(BIN_DIST_NAME) | bzip2 -c > ../$(BIN_DIST_PREP_TAR_BZ2)
 
 windows-installer:
-       "$(ISCC)" /O. /F$(WINDOWS_INSTALLER_BASE) - < distrib/ghc.iss
+       "$(ISCC)" /O. /Fbindistprep/$(WINDOWS_INSTALLER_BASE) - < distrib/ghc.iss
 
 nTimes = set -e; for i in `seq 1 $(1)`; do echo Try "$$i: $(2)"; if $(2); then break; fi; done
 
@@ -1069,6 +1071,11 @@ $(foreach lib,$(PACKAGES) $(PACKAGES_STAGE2),\
   $(eval $(call clean-target,libraries/$(lib),dist-install,libraries/$(lib)/dist-install)))
 endif
 
+clean : clean_bindistprep
+.PHONY: clean_bindistprep
+clean_bindistprep:
+       "$(RM)" $(RM_OPTS) -r bindistprep/
+
 distclean : clean
        "$(RM)" $(RM_OPTS) config.cache config.status config.log mk/config.h mk/stamp-h
        "$(RM)" $(RM_OPTS) mk/config.mk mk/are-validating.mk mk/project.mk