From: rrt Date: Wed, 14 Mar 2001 12:13:02 +0000 (+0000) Subject: [project @ 2001-03-14 12:13:02 by rrt] X-Git-Tag: Approximately_9120_patches~2413 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=bdf9402375186fa1802345b7419586ad36894576;p=ghc-hetmet.git [project @ 2001-03-14 12:13:02 by rrt] Add Config.hs generation to Makefile to make TMPDIR work in KludgedSystem. --- diff --git a/ghc/utils/hsc2hs/KludgedSystem.hs b/ghc/utils/hsc2hs/KludgedSystem.hs index 4794ee8..0b5bcd4 100644 --- a/ghc/utils/hsc2hs/KludgedSystem.hs +++ b/ghc/utils/hsc2hs/KludgedSystem.hs @@ -1,6 +1,6 @@ {-# OPTIONS -cpp -fglasgow-exts #-} ----------------------------------------------------------------------------- --- $Id: KludgedSystem.hs,v 1.3 2001/03/13 17:46:56 rrt Exp $ +-- $Id: KludgedSystem.hs,v 1.4 2001/03/14 12:13:02 rrt Exp $ -- system that works feasibly under Windows (i.e. passes the command line to sh, -- because system() under Windows doesn't look at SHELL, and always uses CMD.EXE) @@ -27,8 +27,7 @@ import Config system :: String -> IO ExitCode system cmd = do pid <- getProcessID - tmp_dir <- readIORef v_TmpDir - let tmp = tmp_dir++"/sh"++show pid + let tmp = cDEFAULT_TMPDIR++"/sh"++show pid writeFile tmp (cmd++"\n") bracket_ (return tmp) removeFile $ System.system ("sh - "++tmp) diff --git a/ghc/utils/hsc2hs/Makefile b/ghc/utils/hsc2hs/Makefile index 0ef0962..0f70d89 100644 --- a/ghc/utils/hsc2hs/Makefile +++ b/ghc/utils/hsc2hs/Makefile @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# $Id: Makefile,v 1.10 2001/03/05 00:07:23 qrczak Exp $ +# $Id: Makefile,v 1.11 2001/03/14 12:13:02 rrt Exp $ TOP=../.. include $(TOP)/mk/boilerplate.mk @@ -54,6 +54,22 @@ INSTALL_LIBEXECS += $(HS_PROG) override datadir=$(libdir) INSTALL_DATAS += template-hsc.h +# ----------------------------------------------------------------------------- +# Create driver configuration + +CURRENT_DIR=ghc/utils/hsc2hs +CONFIG_HS = Config.hs +boot :: $(CONFIG_HS) + +$(CONFIG_HS) : $(FPTOOLS_TOP)/mk/config.mk Makefile + @$(RM) -f $(CONFIG_HS) + @echo -n "Creating $(CONFIG_HS) ... " + @echo "module Config where" >>$(CONFIG_HS) + @echo "cDEFAULT_TMPDIR = \"$(DEFAULT_TMPDIR)\"" >> $(CONFIG_HS) + @echo done. + +CLEAN_FILES += $(CONFIG_HS) + # don't recurse on 'make install' # ifeq "$(INSTALLING)" "1"