From: Lemmih Date: Thu, 21 Jun 2007 13:06:57 +0000 (+0000) Subject: further fixes to the inplace scripts X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=ee58865d978747ab8d61ce041806f3223b56ef94 further fixes to the inplace scripts --- diff --git a/compiler/Makefile b/compiler/Makefile index 9b24c78..e4860ea 100644 --- a/compiler/Makefile +++ b/compiler/Makefile @@ -702,8 +702,6 @@ SRC_LD_OPTS += -no-link-chk # See comments in $(FPTOOLS_TOP)/utils/ghc-pkg/Makefile for why we use # a real binary here rather than a shell script. -all :: $(odir)/ghc-inplace ghc-inplace - INPLACE_HS = $(odir)/ghc-inplace.hs INPLACE_PROG = $(odir)/ghc-inplace$(exeext) EXCLUDED_SRCS += $(INPLACE_HS) @@ -713,8 +711,8 @@ EXCLUDED_SRCS += $(INPLACE_HS) TOP_ABS=$(subst \\,/,$(FPTOOLS_TOP_ABS_PLATFORM)) $(INPLACE_HS): Makefile $(FPTOOLS_TOP)/mk/config.mk - echo "import System.Cmd; import System.Environment" > $@ - echo "main = getArgs >>= \args -> rawSystem \"$(TOP_ABS)/$(GHC_COMPILER_DIR_REL)/$(GHC_PROG)\" (\"-B$(TOP_ABS)\":args)" >> $@ + echo "import System.Cmd; import System.Environment; import System.Exit" > $@ + echo "main = getArgs >>= \args -> rawSystem \"$(TOP_ABS)/$(GHC_COMPILER_DIR_REL)/$(GHC_PROG)\" (\"-B$(TOP_ABS)\":args) >>= exitWith" >> $@ $(INPLACE_PROG): $(INPLACE_HS) $(GHC) --make $< -o $@ @@ -727,6 +725,8 @@ ifeq "$(stage)" "1" ghc-inplace : $(INPLACE_PROG) $(RM) -f $@ && $(LN_S) $< $@ +all :: ghc-inplace + CLEAN_FILES += ghc-inplace endif diff --git a/utils/ghc-pkg/Makefile b/utils/ghc-pkg/Makefile index 3a8cfdf..9508b52 100644 --- a/utils/ghc-pkg/Makefile +++ b/utils/ghc-pkg/Makefile @@ -66,8 +66,8 @@ EXCLUDED_SRCS+=$(INPLACE_HS) TOP_ABS=$(subst \\,/,$(FPTOOLS_TOP_ABS_PLATFORM)) $(INPLACE_HS): Makefile $(FPTOOLS_TOP)/mk/config.mk - echo "import System.Cmd; import System.Environment" > $@ - echo "main = getArgs >>= \args -> rawSystem \"$(TOP_ABS)/$(GHC_PKG_DIR_REL)/$(HS_PROG)\" (\"--global-conf\":\"$(TOP_ABS)/driver/package.conf.inplace\":args)" >> $@ + echo "import System.Cmd; import System.Environment; import System.Exit" > $@ + echo "main = getArgs >>= \args -> rawSystem \"$(TOP_ABS)/$(GHC_PKG_DIR_REL)/$(HS_PROG)\" (\"--global-conf\":\"$(TOP_ABS)/driver/package.conf.inplace\":args) >>= exitWith" >> $@ $(INPLACE_PROG): $(INPLACE_HS) $(GHC) --make $< -o $@ diff --git a/utils/hsc2hs/Makefile b/utils/hsc2hs/Makefile index 9571a45..25b231d 100644 --- a/utils/hsc2hs/Makefile +++ b/utils/hsc2hs/Makefile @@ -44,8 +44,8 @@ extra_flags= endif $(INPLACE_HS): Makefile $(FPTOOLS_TOP)/mk/config.mk - echo "import System.Cmd; import System.Environment" > $@ - echo "main = getArgs >>= \args -> rawSystem \"$(TOP_ABS)/$(GHC_HSC2HS_DIR_REL)/$(HS_PROG)\" (\"--cc=$(CC)\":\"--ld=$(LD)\"$(patsubst %,:\"%\",$(extra_flags)):\"--cflag=-D__GLASGOW_HASKELL__=$(ProjectVersionInt)\":\"-I$(FPTOOLS_TOP_ABS_PLATFORM)/$(GHC_INCLUDE_DIR_REL)\":args)" >> $@ + echo "import System.Cmd; import System.Environment; import System.Exit" > $@ + echo "main = getArgs >>= \args -> rawSystem \"$(TOP_ABS)/$(GHC_HSC2HS_DIR_REL)/$(HS_PROG)\" (\"--cc=$(CC)\":\"--ld=$(LD)\"$(patsubst %,:\"%\",$(extra_flags)):\"--cflag=-D__GLASGOW_HASKELL__=$(ProjectVersionInt)\":\"-I$(FPTOOLS_TOP_ABS_PLATFORM)/$(GHC_INCLUDE_DIR_REL)\":args) >>= exitWith" >> $@ $(INPLACE_PROG): $(INPLACE_HS) $(GHC) --make $< -o $@