Add a GHC layout extension to the alternative layout rule
[ghc-hetmet.git] / utils / ghc-cabal / ghc.mk
index b4b599d..b238db9 100644 (file)
@@ -21,6 +21,10 @@ 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): $(GHC_CABAL_DIR)/ghc-cabal.hs | $$(dir $$@)/. bootstrapping/.
        "$(GHC)" $(SRC_HC_OPTS) --make $(GHC_CABAL_DIR)/ghc-cabal.hs -o $@ \
               -Wall $(WERROR) \
@@ -77,7 +81,7 @@ $(GHC_CABAL_DIR)/dist-dummy-ghc/build/dummy-ghc.hs : $(GHC_CABAL_DIR)/ghc.mk $(M
 #   ["PostfixOperators"] ++
        echo 'extensions :: [String]'                                     >> $@
        echo 'extensions ='                                               >> $@
-       sed '/^xFlags/,/]/{/^  (/{s/^[^"]*"/  ["/; s/"[^"]*$$/"] ++/; p}}; d' compiler/main/DynFlags.hs >> $@
+       '$(SED)' '/^xFlags/,/]/s/^[[:space:]]*([[:space:]]*\("[^"]*"\)[^"]*/  [\1] ++/p;d' compiler/main/DynFlags.hs >> $@
        echo '  []'                                                       >> $@
 
 # We don't build dummy-ghc with Cabal, so we need to pass -package