X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FMakefile;h=0b8453603092cf04442854163b56b9a2b3673136;hp=5e5504bd4124529e839f4ab37a877fc9a02ba058;hb=8bac478832e0cf9fa7ad1cfc81c08b0b9f13938e;hpb=ce5c7f0db0d0b2bf0be171eb8d5fbebe7df97fcb diff --git a/compiler/Makefile b/compiler/Makefile index 5e5504b..0b84536 100644 --- a/compiler/Makefile +++ b/compiler/Makefile @@ -367,7 +367,7 @@ SRC_HC_OPTS += -Istage$(stage) ALL_DIRS = \ utils basicTypes types hsSyn prelude rename typecheck deSugar coreSyn \ - specialise simplCore stranal stgSyn simplStg codeGen main \ + vectorise specialise simplCore stranal stgSyn simplStg codeGen main \ profiling parser cprAnalysis ndpFlatten iface cmm # Make sure we include Config.hs even if it doesn't exist yet... @@ -710,9 +710,17 @@ EXCLUDED_SRCS += $(INPLACE_HS) # will go wrong when we use it in a Haskell string below. TOP_ABS=$(subst \\,/,$(FPTOOLS_TOP_ABS_PLATFORM)) +ifeq "$(stage)" "1" +EnvImport = System.Environment +GetArgs = getArgs +else +EnvImport = GHC.Environment +GetArgs = getFullArgs +endif + $(INPLACE_HS): Makefile $(FPTOOLS_TOP)/mk/config.mk - echo "import System.Cmd; import System.Environment; import System.Exit" > $@ - echo "main = do args <- getArgs; rawSystem \"$(TOP_ABS)/$(GHC_COMPILER_DIR_REL)/$(GHC_PROG)\" (\"-B$(TOP_ABS)\":args) >>= exitWith" >> $@ + echo "import System.Cmd; import $(EnvImport); import System.Exit" > $@ + echo "main = do args <- $(GetArgs); rawSystem \"$(TOP_ABS)/$(GHC_COMPILER_DIR_REL)/$(GHC_PROG)\" (\"-B$(TOP_ABS)\":args) >>= exitWith" >> $@ $(INPLACE_PROG): $(INPLACE_HS) $(HC) --make $< -o $@