diff options
author | Ian Lynagh <igloo@earth.li> | 2011-06-23 18:36:51 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2011-06-23 18:36:51 +0100 |
commit | 0ae70f981bf07cd116ee17199d3a9bd4c1aade62 (patch) | |
tree | 15b8a3e4d7c5a5c5fe45ceb170c27627e5e01cc6 | |
parent | ab7c49bde59b4f80ae153e41132850403ed11965 (diff) | |
download | haskell-0ae70f981bf07cd116ee17199d3a9bd4c1aade62.tar.gz |
Follow Cabal reorganisation, and improve build system a little
-rwxr-xr-x | boot | 1 | ||||
-rw-r--r-- | ghc.mk | 23 | ||||
-rw-r--r-- | ghc/ghc.mk | 1 | ||||
-rw-r--r-- | rules/build-package.mk | 2 | ||||
-rw-r--r-- | utils/ghc-cabal/ghc.mk | 10 | ||||
-rw-r--r-- | utils/ghc-pkg/ghc.mk | 2 |
6 files changed, 20 insertions, 19 deletions
@@ -174,6 +174,7 @@ sub boot_pkgs { or die "Opening $package/ghc.mk failed: $!"; print GHCMK "${package}_PACKAGE = ${pkg}\n"; print GHCMK "${package}_dist-install_GROUP = libraries\n"; + print GHCMK "\$(if \$(filter ${dir},\$(STAGE0_PACKAGES)),\$(eval \$(call build-package,${package},dist-boot,0)))\n"; print GHCMK "\$(eval \$(call build-package,${package},dist-install,\$(if \$(filter ${dir},\$(STAGE2_PACKAGES)),2,1)))\n"; close GHCMK or die "Closing $package/ghc.mk failed: $!"; @@ -313,7 +313,7 @@ TH_PACKAGES := $(DPH_PACKAGES) # # We assume that the stage0 compiler has a suitable bytestring package, # so we don't have to include it below. -STAGE0_PACKAGES = Cabal hpc extensible-exceptions binary bin-package-db hoopl +STAGE0_PACKAGES = Cabal/cabal hpc extensible-exceptions binary bin-package-db hoopl # These packages are installed, but are installed hidden # Why install them at all? Because the 'ghc' package depends on them @@ -393,7 +393,7 @@ $(eval $(call addPackage,haskell2010)) $(eval $(call addPackage,hpc)) $(eval $(call addPackage,pretty)) $(eval $(call addPackage,template-haskell)) -$(eval $(call addPackage,Cabal)) +$(eval $(call addPackage,Cabal/cabal)) $(eval $(call addPackage,binary)) $(eval $(call addPackage,bin-package-db)) $(eval $(call addPackage,hoopl)) @@ -456,7 +456,10 @@ endif # -------------------------------- # Misc package-related settings -BOOT_PKG_CONSTRAINTS := $(foreach p,$(STAGE0_PACKAGES),--constraint "$p == $(shell grep -i "^Version:" libraries/$p/$p.cabal | sed "s/[^0-9.]//g")") +BOOT_PKG_CONSTRAINTS := \ + $(foreach d,$(STAGE0_PACKAGES),\ + $(foreach p,$(basename $(notdir $(wildcard libraries/$d/*.cabal))),\ + --constraint "$p == $(shell grep -i "^Version:" libraries/$d/$p.cabal | sed "s/[^0-9.]//g")")) # The actual .a and .so/.dll files: needed for dependencies. ALL_STAGE1_LIBS = $(foreach lib,$(PACKAGES),$(libraries/$(lib)_dist-install_v_LIB)) @@ -672,16 +675,6 @@ endif $(eval $(call clean-target,$(BOOTSTRAPPING_CONF),,$(BOOTSTRAPPING_CONF))) -# These three libraries do not depend on each other, so we can build -# them straight off: - -$(eval $(call build-package,libraries/hpc,dist-boot,0)) -$(eval $(call build-package,libraries/extensible-exceptions,dist-boot,0)) -$(eval $(call build-package,libraries/Cabal,dist-boot,0)) -$(eval $(call build-package,libraries/binary,dist-boot,0)) -$(eval $(call build-package,libraries/bin-package-db,dist-boot,0)) -$(eval $(call build-package,libraries/hoopl,dist-boot,0)) - # register the boot packages in strict sequence, because running # multiple ghc-pkgs in parallel doesn't work (registrations may get # lost). @@ -689,7 +682,9 @@ fixed_pkg_prev= $(foreach pkg,$(STAGE0_PACKAGES),$(eval $(call fixed_pkg_dep,$(pkg),dist-boot))) compiler/stage1/package-data.mk : $(fixed_pkg_prev) +endif +ifneq "$(BINDIST)" "YES" # 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 # GHCI libs, and we don't have a better way to express that dependency. @@ -1145,6 +1140,8 @@ clean_libraries: # We have to define a clean target for each library manually, because the # libraries/*/ghc.mk files are not included when we're cleaning. ifeq "$(CLEANING)" "YES" +$(foreach lib,$(STAGE0_PACKAGES),\ + $(eval $(call clean-target,libraries/$(lib),dist-boot,libraries/$(lib)/dist-boot))) $(foreach lib,$(PACKAGES) $(PACKAGES_STAGE2),\ $(eval $(call clean-target,libraries/$(lib),dist-install,libraries/$(lib)/dist-install))) endif diff --git a/ghc/ghc.mk b/ghc/ghc.mk index da9fd8a293..d270a7ad9d 100644 --- a/ghc/ghc.mk +++ b/ghc/ghc.mk @@ -94,6 +94,7 @@ $(eval $(call build-prog,ghc,stage3,2)) ifneq "$(BINDIST)" "YES" +ghc/stage1/build/tmp/$(ghc_stage1_PROG) : $(BOOT_LIBS) ifeq "$(GhcProfiled)" "YES" ghc/stage2/build/tmp/$(ghc_stage2_PROG) : $(compiler_stage2_p_LIB) ghc/stage2/build/tmp/$(ghc_stage2_PROG) : $(foreach lib,$(PACKAGES),$(libraries/$(lib)_dist-install_p_LIB)) diff --git a/rules/build-package.mk b/rules/build-package.mk index c735e5137a..c15a8c5c50 100644 --- a/rules/build-package.mk +++ b/rules/build-package.mk @@ -132,7 +132,9 @@ check_$1: $$(GHC_CABAL_INPLACE) $$(GHC_CABAL_INPLACE) check $1 endif +ifneq "$3" "0" $(call haddock,$1,$2) +endif # Don't put bootstrapping packages in the bindist ifneq "$3" "0" diff --git a/utils/ghc-cabal/ghc.mk b/utils/ghc-cabal/ghc.mk index 9026eb18a8..bb28a3a2f9 100644 --- a/utils/ghc-cabal/ghc.mk +++ b/utils/ghc-cabal/ghc.mk @@ -14,16 +14,16 @@ # Euch, hideous hack: # XXX This should be in a different Makefile -CABAL_DOTTED_VERSION := $(shell grep "^Version:" libraries/Cabal/Cabal.cabal | sed "s/^Version: //") +CABAL_DOTTED_VERSION := $(shell grep "^Version:" libraries/Cabal/cabal/Cabal.cabal | sed "s/^Version: //") CABAL_VERSION := $(subst .,$(comma),$(CABAL_DOTTED_VERSION)) CABAL_CONSTRAINT := --constraint="Cabal == $(CABAL_DOTTED_VERSION)" $(GHC_CABAL_INPLACE) : $(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext) | $$(dir $$@)/. "$(CP)" $< $@ -$(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(wildcard libraries/Cabal/Distribution/*/*/*.hs) -$(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(wildcard libraries/Cabal/Distribution/*/*.hs) -$(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(wildcard libraries/Cabal/Distribution/*.hs) +$(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(wildcard libraries/Cabal/cabal/Distribution/*/*/*.hs) +$(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(wildcard libraries/Cabal/cabal/Distribution/*/*.hs) +$(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(wildcard libraries/Cabal/cabal/Distribution/*.hs) $(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(GHC_CABAL_DIR)/Main.hs | $$(dir $$@)/. bootstrapping/. "$(GHC)" $(SRC_HC_OPTS) --make $(GHC_CABAL_DIR)/Main.hs -o $@ \ @@ -32,7 +32,7 @@ $(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(GHC_CABAL_DIR)/Main.hs | $ -DCABAL_VERSION=$(CABAL_VERSION) \ -odir bootstrapping \ -hidir bootstrapping \ - -ilibraries/Cabal \ + -ilibraries/Cabal/cabal \ -ilibraries/filepath \ -ilibraries/hpc touch $@ diff --git a/utils/ghc-pkg/ghc.mk b/utils/ghc-pkg/ghc.mk index 6bc9be57a4..03c9523e37 100644 --- a/utils/ghc-pkg/ghc.mk +++ b/utils/ghc-pkg/ghc.mk @@ -58,7 +58,7 @@ utils/ghc-pkg/dist/build/$(utils/ghc-pkg_dist_PROG)$(exeext): utils/ghc-pkg/Main -hidir bootstrapping \ -iutils/ghc-pkg \ -XCPP -XExistentialQuantification -XDeriveDataTypeable \ - -ilibraries/Cabal \ + -ilibraries/Cabal/cabal \ -ilibraries/filepath \ -ilibraries/extensible-exceptions \ -ilibraries/hpc \ |