merge up to ghc HEAD 16-Apr-2011
[ghc-hetmet.git] / ghc.mk
diff --git a/ghc.mk b/ghc.mk
index d2e4e35..76120ba 100644 (file)
--- a/ghc.mk
+++ b/ghc.mk
@@ -136,6 +136,10 @@ $(error $$(GhcLibWays) is empty, it must contain at least one way)
 endif
 endif
 
+ifeq "$(phase)" ""
+phase = final
+endif
+
 # -----------------------------------------------------------------------------
 # Utility definitions
 
@@ -223,6 +227,7 @@ include rules/package-config.mk
 # -----------------------------------------------------------------------------
 # Building dependencies
 
+include rules/dependencies.mk
 include rules/build-dependencies.mk
 include rules/include-dependencies.mk
 
@@ -507,7 +512,7 @@ endif
 # ----------------------------------------------
 # Checking packages with 'cabal check'
 
-ifeq "$(phase)" ""
+ifeq "$(phase)" "final"
 ifeq "$(CHECK_PACKAGES)" "YES"
 all: check_packages
 endif
@@ -540,7 +545,6 @@ BUILD_DIRS += \
 
 ifneq "$(GhcUnregisterised)" "YES"
 BUILD_DIRS += \
-   $(GHC_MANGLER_DIR) \
    $(GHC_SPLIT_DIR)
 endif
 
@@ -644,7 +648,7 @@ $(foreach p,$(STAGE0_PACKAGES),$(eval libraries/$p_dist-boot_DO_HADDOCK = NO))
 ifeq "$(HADDOCK_DOCS)" "YES"
 libraries/index.html: inplace/bin/haddock$(exeext) $(ALL_HADDOCK_FILES)
        cd libraries && sh gen_contents_index --inplace
-ifeq "$(phase)" ""
+ifeq "$(phase)" "final"
 $(eval $(call all-target,library_doc_index,libraries/index.html))
 endif
 INSTALL_LIBRARY_DOCS += libraries/*.html libraries/*.gif libraries/*.css libraries/*.js
@@ -916,7 +920,6 @@ $(eval $(call bindist,.,\
     $(includes_H_PLATFORM) \
     $(includes_H_FILES) \
     includes/ghcconfig.h \
-    includes/rts/Config.h \
     $(INSTALL_HEADERS) \
     $(INSTALL_LIBEXECS) \
     $(INSTALL_LIBEXEC_SCRIPTS) \
@@ -1208,3 +1211,15 @@ phase_0_builds: $(utils/genprimopcode_dist_depfile_c_asm)
 .PHONY: phase_1_builds
 phase_1_builds: $(PACKAGE_DATA_MKS)
 
+# -----------------------------------------------------------------------------
+# Support for writing GHC passes in Coq
+
+compiler/hetmet/Makefile:
+       git submodule update --init compiler/hetmet
+       cd compiler/hetmet/; git checkout master
+compiler/hetmet/build/CoqPass.hs: compiler/hetmet/Makefile $(wildcard compiler/hetmet/src/*.v) $(wildcard compiler/hetmet/src/*.hs)
+       cd compiler/hetmet; make build/CoqPass.hs
+compiler/stage1/build/CoqPass.hs: compiler/hetmet/build/CoqPass.hs
+       cp compiler/hetmet/build/CoqPass.hs $@
+compiler/stage2/build/CoqPass.hs: compiler/hetmet/build/CoqPass.hs
+       cp compiler/hetmet/build/CoqPass.hs $@