Use SRC_HC_OPTS when making ghc-cabal and ghc-pkg
[ghc-hetmet.git] / utils / ghc-cabal / ghc.mk
index c0fd0f3..4ddf294 100644 (file)
@@ -1,4 +1,15 @@
 # -----------------------------------------------------------------------------
+#
+# (c) 2009 The University of Glasgow
+#
+# This file is part of the GHC build system.
+#
+# To understand how the build system works and how to modify it, see
+#      http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
+#      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
+#
+# -----------------------------------------------------------------------------
+
 # Bootstrapping ghc-cabal
 
 # Euch, hideous hack:
@@ -14,7 +25,7 @@ $(GHC_CABAL_INPLACE) : $(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext)
 $(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) $(SRC_HC_OPTS) --make $(GHC_CABAL_DIR)/ghc-cabal.hs -o $@ \
               -Wall $(WERROR) \
               -DCABAL_VERSION=$(CABAL_VERSION) \
               -odir  bootstrapping \
@@ -42,7 +53,8 @@ $(eval $(call all-target,$(GHC_CABAL_DIR),$(GHC_CABAL_INPLACE)))
 $(GHC_CABAL_DIR)_dist-dummy-ghc_MODULES = dummy-ghc
 $(GHC_CABAL_DIR)_dist-dummy-ghc_PROG    = dummy-ghc$(exeext)
 
-$(GHC_CABAL_DIR)/dist-dummy-ghc/build/dummy-ghc.hs : $(GHC_CABAL_DIR)/ghc.mk $(MKDIRHIER)
+# 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" >>$@