{-# OPTIONS -cpp -fglasgow-exts #-}
-----------------------------------------------------------------------------
--- $Id: KludgedSystem.hs,v 1.5 2001/03/27 16:33:17 rrt Exp $
+-- $Id: KludgedSystem.hs,v 1.6 2001/04/02 16:10:05 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)
-module KludgedSystem (system, defaultCompiler) where
+module KludgedSystem (system, defaultCompiler, progNameSuffix) where
#include "../../includes/config.h"
defaultCompiler :: String
defaultCompiler = "gcc"
+progNameSuffix = ""
#else
defaultCompiler :: String
defaultCompiler = "gcc -mno-cygwin -mwin32"
+progNameSuffix = ".exe"
#endif /* mingw32_TARGET_OS */
------------------------------------------------------------------------
--- $Id: Main.hs,v 1.29 2001/03/29 17:56:18 qrczak Exp $
+-- $Id: Main.hs,v 1.30 2001/04/02 16:10:05 rrt Exp $
--
-- Program for converting .hsc files to .hs files, by converting the
-- file into a C program which is run to generate the Haskell source.
import GetOpt
import System (getProgName, getArgs, ExitCode(..), exitWith, exitFailure)
-import KludgedSystem (system, defaultCompiler)
+import KludgedSystem
import Directory (removeFile)
import Monad (MonadPlus(..), liftM, liftM2, when, unless)
import Char (isAlpha, isAlphaNum, isSpace, isDigit, toUpper, intToDigit, ord)
let cProgName = outDir++outBase++"_hsc_make.c"
oProgName = outDir++outBase++"_hsc_make.o"
- progName = outDir++outBase++"_hsc_make"
+ progName = outDir++outBase++"_hsc_make" ++ progNameSuffix
outHName = outDir++outBase++"_hsc.h"
outCName = outDir++outBase++"_hsc.c"