Tidy up gmp cleaning
[ghc-hetmet.git] / ghc.mk
diff --git a/ghc.mk b/ghc.mk
index 7853aff..5040ff5 100644 (file)
--- a/ghc.mk
+++ b/ghc.mk
@@ -493,12 +493,10 @@ libraries/ghc-prim_dist-install_EXTRA_HADDOCK_SRCS = libraries/ghc-prim/dist-ins
 ifneq "$(CLEANING)" "YES"
 ifeq "$(INTEGER_LIBRARY)" "integer-gmp"
 libraries/base_dist-install_CONFIGURE_OPTS += --flags=-integer-simple
+else ifeq "$(INTEGER_LIBRARY)" "integer-simple"
+libraries/base_dist-install_CONFIGURE_OPTS += --flags=integer-simple
 else
-    ifeq "$(INTEGER_LIBRARY)" "integer-simple"
-       libraries/base_dist-install_CONFIGURE_OPTS += --flags=integer-simple
-    else
 $(error Unknown integer library: $(INTEGER_LIBRARY))
-    endif
 endif
 endif
 
@@ -569,6 +567,8 @@ endif
 
 ifeq "$(INTEGER_LIBRARY)" "integer-gmp"
 BUILD_DIRS += libraries/integer-gmp/gmp
+else ifneq "$(findstring clean,$(MAKECMDGOALS))" ""
+BUILD_DIRS += libraries/integer-gmp/gmp
 endif
 
 BUILD_DIRS += \
@@ -638,6 +638,10 @@ $(foreach lib,$(STAGE0_PACKAGES),$(eval \
   libraries/$(lib)_dist-boot_CONFIGURE_PHASE = 1))
 compiler_stage1_CONFIGURE_PHASE = 1
 ghc_stage1_CONFIGURE_PHASE = 1
+driver/ghc_dist_CONFIGURE_PHASE = 1
+driver/ghci_dist_CONFIGURE_PHASE = 1
+driver/haddock_dist_CONFIGURE_PHASE = 1
+utils/touchy_dist_CONFIGURE_PHASE = 1
 
 # In phase 2, the phase 1 things actually get built
 
@@ -738,11 +742,7 @@ $(eval $(call build-package,libraries/bin-package-db,dist-boot,0))
 fixed_pkg_prev=
 $(foreach pkg,$(STAGE0_PACKAGES),$(eval $(call fixed_pkg_dep,$(pkg),dist-boot)))
 
-compiler/stage1/package-data.mk : \
-    libraries/Cabal/dist-boot/package-data.mk \
-    libraries/hpc/dist-boot/package-data.mk \
-    libraries/extensible-exceptions/dist-boot/package-data.mk \
-    libraries/bin-package-db/dist-boot/package-data.mk
+compiler/stage1/package-data.mk : $(fixed_pkg_prev)
 
 # Make sure we have all the GHCi libs by the time we've built
 # ghc-stage2.  DPH includes a bit of Template Haskell which needs the
@@ -1189,17 +1189,6 @@ clean : clean_files clean_libraries
 clean_files :
        "$(RM)" $(RM_OPTS) $(CLEAN_FILES)
 
-ifneq "$(NO_CLEAN_GMP)" "YES"
-CLEAN_FILES += libraries/integer-gmp/gmp/gmp.h
-CLEAN_FILES += libraries/integer-gmp/gmp/libgmp.a
-
-clean : clean_gmp
-.PHONY: clean_gmp
-clean_gmp:
-       "$(RM)" $(RM_OPTS_REC) libraries/integer-gmp/gmp/objs
-       "$(RM)" $(RM_OPTS_REC) libraries/integer-gmp/gmp/gmpbuild
-endif
-
 .PHONY: clean_libraries
 clean_libraries: $(patsubst %,clean_libraries/%_dist-install,$(PACKAGES) $(PACKAGES_STAGE2))
 clean_libraries: $(patsubst %,clean_libraries/%_dist-boot,$(STAGE0_PACKAGES))