diff options
-rw-r--r-- | ghc.mk | 10 | ||||
-rw-r--r-- | rules/build-package.mk | 1 | ||||
-rw-r--r-- | rules/build-prog.mk | 6 | ||||
-rw-r--r-- | utils/ghc-pkg/ghc.mk | 69 |
4 files changed, 23 insertions, 63 deletions
@@ -355,7 +355,7 @@ PKGS_THAT_USE_TH := $(PKGS_THAT_ARE_DPH) # # We assume that the stage0 compiler has a suitable bytestring package, # so we don't have to include it below. -PKGS_THAT_BUILD_WITH_STAGE0 = Cabal/Cabal hpc binary bin-package-db hoopl transformers +PKGS_THAT_BUILD_WITH_STAGE0 = Cabal/Cabal hpc binary bin-package-db hoopl transformers terminfo # $(EXTRA_PACKAGES) is another classification, of packages built but # not installed @@ -464,7 +464,7 @@ $(eval $(call extra-packages)) # parallelism, but we don't know the dependencies until we've # generated the package-data.mk files. define fixed_pkg_dep -libraries/$1/$2/package-data.mk : $$(GHC_PKG_INPLACE) $$(fixed_pkg_prev) +libraries/$1/$2/package-data.mk : $$(fixed_pkg_prev) fixed_pkg_prev:=libraries/$1/$2/package-data.mk endef @@ -738,8 +738,8 @@ $(eval $(call clean-target,$(BOOTSTRAPPING_CONF),,$(BOOTSTRAPPING_CONF))) # lost). fixed_pkg_prev= $(foreach pkg,$(PACKAGES_STAGE0),$(eval $(call fixed_pkg_dep,$(pkg),dist-boot))) - -compiler/stage1/package-data.mk : $(fixed_pkg_prev) +utils/ghc-pkg/dist/package-data.mk: $(fixed_pkg_prev) +compiler/stage1/package-data.mk: $(fixed_pkg_prev) endif ifneq "$(BINDIST)" "YES" @@ -1333,6 +1333,8 @@ endif # Numbered phase targets .PHONY: phase_0_builds +phase_0_builds: $(utils/ghc-pkg_dist_depfile_haskell) +phase_0_builds: $(utils/ghc-pkg_dist_depfile_c_asm) phase_0_builds: $(utils/hsc2hs_dist_depfile_haskell) phase_0_builds: $(utils/hsc2hs_dist_depfile_c_asm) phase_0_builds: $(utils/genprimopcode_dist_depfile_haskell) diff --git a/rules/build-package.mk b/rules/build-package.mk index 47b706e718..8b9723b318 100644 --- a/rules/build-package.mk +++ b/rules/build-package.mk @@ -123,6 +123,7 @@ $$(foreach way,$$($1_$2_WAYS),$$(eval \ # If dyn libs are not being built then $$($1_$2_dyn_LIB) will just # expand to the empty string, and be ignored. $1_$2_PROGRAM_DEP_LIB = $$($1_$2_v_LIB) $$($1_$2_dyn_LIB) +$$($1_PACKAGE)-$$($1_$2_VERSION)_$2_PROGRAM_DEP_LIB = $$($1_$2_PROGRAM_DEP_LIB) # C and S files are possibly built the "dyn" way. ifeq "$$(BuildSharedLibs)" "YES" diff --git a/rules/build-prog.mk b/rules/build-prog.mk index 0419c3b4ab..400c6208f4 100644 --- a/rules/build-prog.mk +++ b/rules/build-prog.mk @@ -186,13 +186,13 @@ ifneq "$$(BINDIST)" "YES" # The quadrupled $'s here are because the _<way>_LIB variables aren't # necessarily set when this part of the makefile is read $1/$2/build/tmp/$$($1_$2_PROG) : \ - $$(foreach dep,$$($1_$2_DEP_NAMES),\ - $$(if $$(filter ghc,$$(dep)),\ + $$(foreach dep,$$($1_$2_DEPS),\ + $$(if $$(filter ghc%,$$(dep)),\ $(if $(filter 0,$3),$$(compiler_stage1_PROGRAM_DEP_LIB),\ $(if $(filter 1,$3),$$(compiler_stage2_PROGRAM_DEP_LIB),\ $(if $(filter 2,$3),$$(compiler_stage2_PROGRAM_DEP_LIB),\ $$(error Bad build stage)))),\ - $$$$(libraries/$$(dep)_dist-$(if $(filter 0,$3),boot,install)_PROGRAM_DEP_LIB))) + $$$$($$(dep)_dist-$(if $(filter 0,$3),boot,install)_PROGRAM_DEP_LIB))) ifeq "$$($1_$2_LINK_WITH_GCC)" "NO" $1/$2/build/tmp/$$($1_$2_PROG) : $$($1_$2_$$($1_$2_PROGRAM_WAY)_HS_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_C_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_S_OBJS) $$($1_$2_OTHER_OBJS) | $$$$(dir $$$$@)/. diff --git a/utils/ghc-pkg/ghc.mk b/utils/ghc-pkg/ghc.mk index d904c48d11..fac39e8d5e 100644 --- a/utils/ghc-pkg/ghc.mk +++ b/utils/ghc-pkg/ghc.mk @@ -15,60 +15,6 @@ utils/ghc-pkg_dist_PROG = ghc-pkg$(exeext) -ifeq "$(BootingFromHc)" "YES" - -inplace/bin/ghc-pkg : utils/ghc-pkg/dist-install/build/tmp/$(utils/ghc-pkg_dist_PROG)$(exeext) -ifeq "$(Windows)" "YES" - cp $< $@ -else - $(call removeFiles,$@) - echo "#!/bin/sh" >>$@ - echo "PKGCONF=$(TOP)/$(INPLACE_PACKAGE_CONF)" >>$@ - echo '$(TOP)/$< --global-package-db $$PKGCONF $${1+"$$@"}' >> $@ - chmod +x $@ -endif - -else - -$(GHC_PKG_INPLACE) : utils/ghc-pkg/dist/build/tmp/$(utils/ghc-pkg_dist_PROG)$(exeext) | $$(dir $$@)/. $(INPLACE_PACKAGE_CONF)/. - $(call removeFiles,$(wildcard $(INPLACE_PACKAGE_CONF)/*)) -ifeq "$(Windows)" "YES" - cp $< $@ -else - $(call removeFiles,$@) - echo "#!/bin/sh" >>$@ - echo "PKGCONF=$(TOP)/$(INPLACE_PACKAGE_CONF)" >>$@ - echo '$(TOP)/$< --global-package-db $$PKGCONF $${1+"$$@"}' >> $@ - chmod +x $@ -endif - -endif - -# depend on ghc-cabal, otherwise we build Cabal twice when building in parallel. -# (ghc-cabal is an order-only dependency, we don't need to rebuild ghc-pkg -# if ghc-cabal is newer). -# The binary package is not warning-clean, so we need a few -fno-warns here. -# -# ToDo: we might want to do this using ghc-cabal instead. -# -utils/ghc-pkg/dist/build/tmp/$(utils/ghc-pkg_dist_PROG)$(exeext): utils/ghc-pkg/Main.hs utils/ghc-pkg/dist/build/Version.hs | bootstrapping/. $$(dir $$@)/. $(GHC_CABAL_INPLACE) - "$(GHC)" $(SRC_HC_OPTS) --make utils/ghc-pkg/Main.hs -o $@ \ - -no-user-$(GHC_PACKAGE_DB_FLAG) \ - -Wall -fno-warn-unused-imports -fno-warn-warnings-deprecations \ - $(SRC_HC_WARNING_OPTS) \ - -DCABAL_VERSION=$(CABAL_VERSION) \ - -DBOOTSTRAPPING \ - -odir bootstrapping \ - -hidir bootstrapping \ - -iutils/ghc-pkg \ - -iutils/ghc-pkg/dist/build \ - -ilibraries/Cabal/Cabal \ - -ilibraries/filepath \ - -ilibraries/hpc \ - -ilibraries/binary/src \ - -ilibraries/bin-package-db - - utils/ghc-pkg/dist/build/Version.hs \ utils/ghc-pkg/dist-install/build/Version.hs: mk/project.mk | $$(dir $$@)/. $(call removeFiles,$@) @@ -78,7 +24,7 @@ utils/ghc-pkg/dist-install/build/Version.hs: mk/project.mk | $$(dir $$@)/. echo "targetOS = \"$(TargetOS_CPP)\"" >> $@ echo "targetARCH = \"$(TargetArch_CPP)\"" >> $@ -$(eval $(call clean-target,utils/ghc-pkg,dist,utils/ghc-pkg/dist)) +utils/ghc-pkg_PACKAGE = ghc-pkg # ----------------------------------------------------------------------------- # Cross-compile case: install our dist version @@ -96,13 +42,24 @@ $(eval $(call shell-wrapper,utils/ghc-pkg,dist)) endif +utils/ghc-pkg_dist_USES_CABAL = YES +utils/ghc-pkg_dist_PROG = ghc-pkg +utils/ghc-pkg_dist_SHELL_WRAPPER = YES +utils/ghc-pkg_dist_INSTALL_INPLACE = YES + +$(eval $(call build-prog,utils/ghc-pkg,dist,0)) + +$(GHC_PKG_INPLACE) : | $(INPLACE_PACKAGE_CONF)/. + +utils/ghc-pkg/dist/package-data.mk: \ + utils/ghc-pkg/dist/build/Version.hs + # ----------------------------------------------------------------------------- # Normal case: Build ghc-pkg with stage 1 and install it ifneq "$(Stage1Only)" "YES" utils/ghc-pkg_dist-install_USES_CABAL = YES -utils/ghc-pkg_PACKAGE = ghc-pkg utils/ghc-pkg_dist-install_PROG = ghc-pkg utils/ghc-pkg_dist-install_SHELL_WRAPPER = YES |