X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=utils%2Fghc-cabal%2Fghc.mk;h=9026eb18a8aa2466f9b79bd30c53b98993ed35a8;hb=e5c3b478b3cd1707cf122833822f44b2ac09b8e9;hp=b73d413bcff91b9a0c1f3f94dec3c154518070d2;hpb=d346b2e9f580c872305a4619a28a9536f8ba8082;p=ghc-hetmet.git diff --git a/utils/ghc-cabal/ghc.mk b/utils/ghc-cabal/ghc.mk index b73d413..9026eb1 100644 --- a/utils/ghc-cabal/ghc.mk +++ b/utils/ghc-cabal/ghc.mk @@ -18,14 +18,16 @@ CABAL_DOTTED_VERSION := $(shell grep "^Version:" libraries/Cabal/Cabal.cabal | s 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) - $(MKDIRHIER) $(dir $@) - $(CP) $< $@ +$(GHC_CABAL_INPLACE) : $(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext) | $$(dir $$@)/. + "$(CP)" $< $@ -$(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(GHC_CABAL_DIR)/ghc-cabal.hs $(MKDIRHIER) - $(MKDIRHIER) bootstrapping - $(MKDIRHIER) $(dir $@) - $(GHC) --make $(GHC_CABAL_DIR)/ghc-cabal.hs -o $@ \ +$(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): $(GHC_CABAL_DIR)/Main.hs | $$(dir $$@)/. bootstrapping/. + "$(GHC)" $(SRC_HC_OPTS) --make $(GHC_CABAL_DIR)/Main.hs -o $@ \ + -no-user-package-conf \ -Wall $(WERROR) \ -DCABAL_VERSION=$(CABAL_VERSION) \ -odir bootstrapping \ @@ -44,23 +46,14 @@ $(eval $(call clean-target,$(GHC_CABAL_DIR),dist,\ $(eval $(call all-target,$(GHC_CABAL_DIR),$(GHC_CABAL_INPLACE))) # ----------------------------------------------------------------------------- -# dummy-ghc - -# This is a tiny program to fool Cabal's configure that we have a -# stage1 GHC, which lets us configure all the packages before we've -# build stage1. - -$(GHC_CABAL_DIR)_dist-dummy-ghc_MODULES = dummy-ghc -$(GHC_CABAL_DIR)_dist-dummy-ghc_PROG = dummy-ghc$(exeext) +# Now make another copy that goes in bindists. This needs to be built +# with the in-tree compiler. -# depend on config.mk, so we pick up the new version number if it changes. -$(GHC_CABAL_DIR)/dist-dummy-ghc/build/dummy-ghc.hs : $(GHC_CABAL_DIR)/ghc.mk $(MKDIRHIER) mk/config.mk - $(MKDIRHIER) $(dir $@) - echo "import System.Environment; import System.Cmd; import System.Exit" >$@ - echo "main = do args <- getArgs; if args == [\"--numeric-version\"] then putStrLn \"$(ProjectVersion)\" else do e <- rawSystem \"$(GHC_STAGE0)\" args; exitWith e" >>$@ +$(GHC_CABAL_DIR)_USES_CABAL = YES +$(GHC_CABAL_DIR)_PACKAGE = ghc-cabal +$(GHC_CABAL_DIR)_dist-install_PROG = ghc-cabal$(exeext) +$(GHC_CABAL_DIR)_dist-install_INSTALL_INPLACE = NO +$(GHC_CABAL_DIR)_dist-install_MODULES = Main -# We don't build dummy-ghc with Cabal, so we need to pass -package -# flags manually -utils/ghc-cabal_dist-dummy-ghc_HC_OPTS = -package process -$(eval $(call build-prog,utils/ghc-cabal,dist-dummy-ghc,0)) +$(eval $(call build-prog,utils/ghc-cabal,dist-install,1))