Quote commands that we run, so they work if there are space in their paths
[ghc-hetmet.git] / utils / ghc-cabal / ghc.mk
index 32f31b0..6ae87e5 100644 (file)
@@ -19,13 +19,13 @@ 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) $< $@
+       "$(MKDIRHIER)" $(dir $@)
+       "$(CP)" $< $@
 
 $(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(GHC_CABAL_DIR)/ghc-cabal.hs $(MKDIRHIER)
-       $(MKDIRHIER) bootstrapping
-       $(MKDIRHIER) $(dir $@)
-       $(GHC) $(SRC_HC_OPTS) --make $(GHC_CABAL_DIR)/ghc-cabal.hs -o $@ \
+       "$(MKDIRHIER)" bootstrapping
+       "$(MKDIRHIER)" $(dir $@)
+       "$(GHC)" $(SRC_HC_OPTS) --make $(GHC_CABAL_DIR)/ghc-cabal.hs -o $@ \
               -Wall $(WERROR) \
               -DCABAL_VERSION=$(CABAL_VERSION) \
               -odir  bootstrapping \
@@ -55,7 +55,7 @@ $(GHC_CABAL_DIR)_dist-dummy-ghc_PROG    = dummy-ghc$(exeext)
 
 # 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 $@)
+       "$(MKDIRHIER)" $(dir $@)
        echo "import System.Environment; import System.Cmd; import System.Exit" >$@
        echo "main :: IO ()" >>$@
        echo "main = do args <- getArgs; if args == [\"--numeric-version\"] then putStrLn \"$(ProjectVersion)\" else do e <- rawSystem \"$(GHC_STAGE0)\" args; exitWith e" >>$@