X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=ghc.mk;h=f79732c06a33f2c29488e29782a48378c5fe09ab;hp=1c41a4a3d60d3a8a40bcd6d0e6983a69f14a5c3a;hb=e95ee1f718c6915c478005aad8af81705357d6ab;hpb=521a4e011066a6bad5923f15468505825632f112 diff --git a/ghc.mk b/ghc.mk index 1c41a4a..f79732c 100644 --- a/ghc.mk +++ b/ghc.mk @@ -101,6 +101,10 @@ endif just-makefiles: @: +ifneq "$(CLEANING)" "YES" +CLEANING = NO +endif + # ----------------------------------------------------------------------------- # Misc GNU make utils @@ -147,6 +151,11 @@ endif endif # ----------------------------------------------------------------------------- +# Utility definitions + +include rules/make-command.mk + +# ----------------------------------------------------------------------------- # Macros for standard targets include rules/all-target.mk @@ -303,6 +312,10 @@ define addPackage # args: $1 = package, $2 = condition endif endef +INTREE_ONLY_PACKAGES := haskeline mtl terminfo utf8-string xhtml + +$(foreach p,$(INTREE_ONLY_PACKAGES),$(eval libraries/$p_dist-install_HADDOCK_ME = NO)) + $(eval $(call addPackage,ghc-prim)) ifeq "$(CLEANING)" "YES" $(eval $(call addPackage,integer-gmp)) @@ -344,15 +357,28 @@ $(eval $(call addPackage,haskeline)) $(foreach pkg,$(EXTRA_PACKAGES),$(eval $(call addPackage,$(pkg)))) + +# ------------------- Adding DPH packaes --------------- + +# The DPH packages are added when: +# * not BootingFromHc (they aren't necessary for bootstrapping), and +# * not GhcProfiled (they need TH, so can't be compiled by a -prof GHC), or +# * CLEANING: when cleaning we always enable everything + +# if !BootingFromHc && (!GhcProfiled || CLEANING) + ifneq "$(BootingFromHc)" "YES" -PACKAGES_STAGE2 += \ - dph/dph-base \ +ifneq "$(GhcProfiled) $(CLEANING)" "NO YES" +PACKAGES_STAGE2 += dph/dph-base \ dph/dph-prim-interface \ dph/dph-prim-seq \ dph/dph-prim-par \ dph/dph-seq \ dph/dph-par endif +endif # BootingFromHc +# ------------------------------------------------------- + # We assume that the stage0 compiler has a suitable bytestring package, # so we don't have to include it below. @@ -520,6 +546,7 @@ BUILD_DIRS += \ driver \ driver/ghci \ driver/ghc \ + driver/haddock \ libffi \ includes \ rts @@ -531,11 +558,9 @@ BUILD_DIRS += \ $(GHC_GENAPPLY_DIR) endif -ifneq "$(HADDOCK_DOCS)" "NO" BUILD_DIRS += \ utils/haddock \ utils/haddock/doc -endif ifneq "$(CLEANING)" "YES" BUILD_DIRS += \ @@ -565,6 +590,11 @@ BUILD_DIRS += \ $(GHC_TOUCHY_DIR) endif +ifneq "$(BINDIST)" "YES" +BUILD_DIRS += \ + utils/mkUserGuidePart +endif + BUILD_DIRS += utils/count_lines BUILD_DIRS += utils/compare_sizes @@ -599,6 +629,7 @@ utils/ghctags_dist_DISABLE = YES utils/hpc_dist_DISABLE = YES utils/hsc2hs_dist-install_DISABLE = YES utils/ghc-pkg_dist-install_DISABLE = YES +utils/mkUserGuidePart_dist_DISABLE = YES utils/compare_sizes_dist_DISABLE = YES compiler_stage2_DISABLE = YES compiler_stage3_DISABLE = YES @@ -647,18 +678,6 @@ GhcBootLibHcOpts += -fno-warn-deprecated-flags # Add $(GhcLibHcOpts) to all library builds $(foreach pkg,$(PACKAGES) $(PACKAGES_STAGE2),$(eval libraries/$(pkg)_dist-install_HC_OPTS += $$(GhcLibHcOpts))) -# XXX Hack; remove this -# Use -Wwarn for dph -$(foreach pkg,$(PACKAGES_STAGE2),$(eval libraries/$(pkg)_dist-install_HC_OPTS += -Wwarn)) - -# XXX Hack; remove this -# Use -Wwarn for 'binary' becuase it has redundant UNPACK pragmas -libraries/binary_dist-install_HC_OPTS += -Wwarn -libraries/binary_dist-boot_HC_OPTS += -Wwarn - -# XXX hack: haskeline has warnings about deprecated use of block/unblock -libraries/haskeline_dist-install_HC_OPTS += -Wwarn - # ---------------------------------------------- # A useful pseudo-target .PHONY: stage1_libs @@ -882,7 +901,7 @@ INSTALLED_GHC_REAL=$(DESTDIR)$(bindir)/ghc.exe INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(bindir)/ghc-pkg.exe endif -INSTALLED_PACKAGES := $(filter-out haskeline mtl terminfo utf8-string xhtml,$(PACKAGES)) +INSTALLED_PACKAGES := $(filter-out $(INTREE_ONLY_PACKAGES),$(PACKAGES)) ifeq "$(InstallExtraPackages)" "NO" INSTALLED_PACKAGES := $(filter-out $(EXTRA_PACKAGES), $(INSTALLED_PACKAGES)) endif @@ -911,18 +930,23 @@ install_packages: libffi/package.conf.install rts/package.conf.install $(INSTALL_DIR) "$(INSTALLED_PACKAGE_CONF)" "$(INSTALLED_GHC_PKG_REAL)" --force --global-conf "$(INSTALLED_PACKAGE_CONF)" update libffi/package.conf.install "$(INSTALLED_GHC_PKG_REAL)" --force --global-conf "$(INSTALLED_PACKAGE_CONF)" update rts/package.conf.install - $(foreach p, $(ALL_INSTALLED_PACKAGES),\ - "$(GHC_CABAL_INPLACE)" install \ - "$(INSTALLED_GHC_REAL)" \ - "$(INSTALLED_GHC_PKG_REAL)" \ - "$(STRIP_CMD)" \ - "$(DESTDIR)$(topdir)" \ - $p $(INSTALL_DISTDIR_$p) \ - '$(DESTDIR)' '$(prefix)' '$(ghclibdir)' '$(docdir)/html/libraries' \ - $(RelocatableBuild) &&) true - $(foreach p, $(HIDDEN_PACKAGES),\ - "$(INSTALLED_GHC_PKG_REAL)" --global-conf "$(INSTALLED_PACKAGE_CONF)" \ - hide $p &&) true + $(foreach p, $(ALL_INSTALLED_PACKAGES), \ + $(call make-command, \ + "$(GHC_CABAL_INPLACE)" install \ + "$(INSTALLED_GHC_REAL)" \ + "$(INSTALLED_GHC_PKG_REAL)" \ + "$(STRIP_CMD)" \ + "$(DESTDIR)$(topdir)" \ + $p $(INSTALL_DISTDIR_$p) \ + '$(DESTDIR)' \ + '$(prefix)' \ + '$(ghclibdir)' \ + '$(docdir)/html/libraries' \ + $(RelocatableBuild))) + $(foreach p, $(HIDDEN_PACKAGES), \ + $(call make-command, \ + "$(INSTALLED_GHC_PKG_REAL)" \ + --global-conf "$(INSTALLED_PACKAGE_CONF)" hide $p)) # ----------------------------------------------------------------------------- # Binary distributions