X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc.mk;h=f25163588ef58d15194f9a82b8c42b7ea0f122cf;hb=cc6b470ed8fe0494148b1629f30d7ae878ee25be;hp=fa286089f1f4cbdf74b66c4347befd558e1286c0;hpb=24adfcd0544942dff994b75f7dd5f72ab3e3d0f4;p=ghc-hetmet.git diff --git a/ghc.mk b/ghc.mk index fa28608..f251635 100644 --- a/ghc.mk +++ b/ghc.mk @@ -134,18 +134,23 @@ show: # ----------------------------------------------------------------------------- # Include subsidiary build-system bits +ifneq "$(findstring clean,$(MAKECMDGOALS))" "" +-include mk/config.mk +else include mk/config.mk - ifeq "$(ProjectVersion)" "" $(error Please run ./configure first) endif +endif # (Optional) build-specific configuration include mk/custom-settings.mk +ifeq "$(findstring clean,$(MAKECMDGOALS))" "" ifeq "$(GhcLibWays)" "" $(error $$(GhcLibWays) is empty, it must contain at least one way) endif +endif # ----------------------------------------------------------------------------- # Macros for standard targets @@ -315,7 +320,6 @@ endif PACKAGES += haskeline -ifneq "$(wildcard libraries/dph)" "" PACKAGES_STAGE2 += \ dph/dph-base \ dph/dph-prim-interface \ @@ -323,7 +327,6 @@ PACKAGES_STAGE2 += \ dph/dph-prim-par \ dph/dph-seq \ dph/dph-par -endif BOOT_PKGS = Cabal hpc extensible-exceptions @@ -483,10 +486,10 @@ BUILD_DIRS += \ utils/haddock/doc \ $(patsubst %, libraries/%, $(PACKAGES)) \ $(patsubst %, libraries/%, $(PACKAGES_STAGE2)) \ + libraries/dph \ compiler \ $(GHC_HSC2HS_DIR) \ $(GHC_PKG_DIR) \ - utils/hasktags \ utils/hpc \ utils/runghc \ ghc @@ -517,7 +520,6 @@ ifneq "$(findstring $(phase),0 1 2 3)" "" utils/haddock_dist_DISABLE = YES utils/runghc_dist_DISABLE = YES utils/hpc_dist_DISABLE = YES -utils/hasktags_dist_DISABLE = YES utils/hsc2hs_dist-install_DISABLE = YES utils/ghc-pkg_dist-install_DISABLE = YES compiler_stage2_DISABLE = YES @@ -528,9 +530,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 @@ -559,9 +558,11 @@ libraries/base3-compat_dist-install_HC_OPTS += -XPackageImports ifneq "$(BINDIST)" "YES" +ifneq "$(BOOTSTRAPPING_CONF)" "" ifeq "$(wildcard $(BOOTSTRAPPING_CONF))" "" $(shell echo "[]" >$(BOOTSTRAPPING_CONF)) endif +endif $(eval $(call clean-target,$(BOOTSTRAPPING_CONF),,$(BOOTSTRAPPING_CONF))) @@ -792,10 +793,7 @@ SRC_DIST_FILES += \ aclocal.m4 README ANNOUNCE HACKING LICENSE Makefile install-sh \ ghc.spec.in ghc.spec extra-gcc-opts.in VERSION boot ghc.mk -EXTRA_LIBS=$(patsubst %, $(SRC_DIST_NAME)/%, $(shell grep -E "extralibs|dph" packages | grep -v "^\#" | sed "s/ .*//")) - SRC_DIST_TARBALL = ghc-$(ProjectVersion)-src.tar.bz2 -SRC_DIST_EXTRALIBS_TARBALL = ghc-$(ProjectVersion)-src-extralibs.tar.bz2 VERSION : echo $(ProjectVersion) >VERSION @@ -842,8 +840,6 @@ sdist-prep : .PHONY: sdist sdist : sdist-prep - $(TAR) chf - $(EXTRA_LIBS) | bzip2 >$(TOP)/$(SRC_DIST_EXTRALIBS_TARBALL) - $(RM) -rf $(EXTRA_LIBS) $(TAR) chf - $(SRC_DIST_NAME) 2>$src_log | bzip2 >$(TOP)/$(SRC_DIST_TARBALL) sdist-manifest : $(SRC_DIST_TARBALL) @@ -854,7 +850,6 @@ sdist-manifest : $(SRC_DIST_TARBALL) # over SSH. ifneq "$(PublishLocation)" "" publish-sdist : - $(call nTimes,10,$(PublishCp) $(SRC_DIST_EXTRALIBS_TARBALL) $(PublishLocation)/dist) $(call nTimes,10,$(PublishCp) $(SRC_DIST_TARBALL) $(PublishLocation)/dist) endif @@ -892,7 +887,11 @@ maintainer-clean : distclean $(RM) configure mk/config.h.in $(RM) -r autom4te.cache libraries/*/autom4te.cache $(RM) ghc.spec - $(RM) libraries/*/GNUmakefile libraries/*/ghc.mk libraries/*/configure + $(RM) $(patsubst %, libraries/%/GNUmakefile, \ + $(PACKAGES) $(PACKAGES_STAGE2)) + $(RM) $(patsubst %, libraries/%/ghc.mk, $(PACKAGES) $(PACKAGES_STAGE2)) + $(RM) $(patsubst %, libraries/%/configure, \ + $(PACKAGES) $(PACKAGES_STAGE2)) $(RM) libraries/base/include/HsBaseConfig.h.in $(RM) libraries/directory/include/HsDirectoryConfig.h.in $(RM) libraries/process/include/HsProcessConfig.h.in