X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc.mk;h=64d317b75663cd7323b5b96720ee3d9627c5b9e9;hb=fc15f6e876f3b8202a1053f809253b39dc8a8923;hp=2fdc0cebb80be70e649915c46d21e240a2e07fe3;hpb=6caa45bf8762fe38bb8d43a6181276f132f3c728;p=ghc-hetmet.git diff --git a/ghc.mk b/ghc.mk index 2fdc0ce..64d317b 100644 --- a/ghc.mk +++ b/ghc.mk @@ -53,7 +53,6 @@ # # * 2966 make sure --with-gcc does the right thing (#2966) # * 1693 make distclean -# * 2689 make maintainer-clean # * 3173 make install with DESTDIR # Possible cleanups: @@ -134,9 +133,9 @@ show: # ----------------------------------------------------------------------------- # Include subsidiary build-system bits -ifneq "$(findstring clean,$(MAKECMDGOALS))" "" --include mk/config.mk -else +include mk/tree.mk + +ifeq "$(findstring clean,$(MAKECMDGOALS))" "" include mk/config.mk ifeq "$(ProjectVersion)" "" $(error Please run ./configure first) @@ -213,6 +212,10 @@ include rules/c-objs.mk # ----------------------------------------------------------------------------- # Suffix rules +# Suffix rules cause "make clean" to fail on Windows (trac #3233) +# so we don't make any when cleaning. +ifneq "$(CLEANING)" "YES" + include rules/hs-suffix-rules-srcdir.mk include rules/hs-suffix-rules.mk @@ -229,6 +232,8 @@ $(foreach way,$(ALL_WAYS),\ include rules/c-suffix-rules.mk +endif + # ----------------------------------------------------------------------------- # Building package-data.mk files from .cabal files @@ -320,7 +325,6 @@ endif PACKAGES += haskeline -ifneq "$(wildcard libraries/dph)" "" PACKAGES_STAGE2 += \ dph/dph-base \ dph/dph-prim-interface \ @@ -328,7 +332,6 @@ PACKAGES_STAGE2 += \ dph/dph-prim-par \ dph/dph-seq \ dph/dph-par -endif BOOT_PKGS = Cabal hpc extensible-exceptions @@ -485,9 +488,15 @@ endif BUILD_DIRS += \ utils/haddock \ - utils/haddock/doc \ - $(patsubst %, libraries/%, $(PACKAGES)) \ - $(patsubst %, libraries/%, $(PACKAGES_STAGE2)) \ + utils/haddock/doc + +ifneq "$(CLEANING)" "YES" +BUILD_DIRS += \ + $(patsubst %, libraries/%, $(PACKAGES) $(PACKAGES_STAGE2)) \ + libraries/dph +endif + +BUILD_DIRS += \ compiler \ $(GHC_HSC2HS_DIR) \ $(GHC_PKG_DIR) \ @@ -531,9 +540,6 @@ $(foreach lib,$(PACKAGES) $(PACKAGES_STAGE2),$(eval \ libraries/$(lib)_dist-install_DISABLE = YES)) endif -ifneq "$(wildcard libraries/dph)" "" -include libraries/dph/ghc.mk -endif include $(patsubst %, %/ghc.mk, $(BUILD_DIRS)) # We need -fno-warn-deprecated-flags to avoid failure with -Werror @@ -742,6 +748,7 @@ $(eval $(call bindist,.,\ $(filter-out %/project.mk,$(filter-out mk/config.mk,$(MAKEFILE_LIST))) \ mk/fix_install_names.sh \ mk/project.mk \ + libraries/dph/LICENSE \ )) # mk/project.mk gets an absolute path, so we manually include it in # the bindist with a relative path @@ -875,6 +882,9 @@ clean : clean_files .PHONY: clean_files clean_files : $(RM) $(CLEAN_FILES) + $(RM) -r $(patsubst %, libraries/%/dist, $(PACKAGES) $(PACKAGES_STAGE2)) + $(RM) -r $(patsubst %, libraries/%/dist-install, $(PACKAGES) $(PACKAGES_STAGE2)) + $(RM) -r $(patsubst %, libraries/%/dist-boot, $(PACKAGES) $(PACKAGES_STAGE2)) distclean : clean $(RM) config.cache config.status config.log mk/config.h mk/stamp-h @@ -886,6 +896,10 @@ distclean : clean $(RM) libraries/process/include/HsProcessConfig.h $(RM) libraries/unix/include/HsUnixConfig.h $(RM) libraries/old-time/include/HsTimeConfig.h + $(RM) $(patsubst %, libraries/%/config.log, $(PACKAGES) $(PACKAGES_STAGE2)) + $(RM) $(patsubst %, libraries/%/config.status, $(PACKAGES) $(PACKAGES_STAGE2)) + $(RM) $(patsubst %, libraries/%/include/Hs*Config.h, $(PACKAGES) $(PACKAGES_STAGE2)) + $(RM) -r $(patsubst %, libraries/%/autom4te.cache, $(PACKAGES) $(PACKAGES_STAGE2)) maintainer-clean : distclean $(RM) configure mk/config.h.in