1
0
forked from GitHub/gf-core

Use the internal preprocessors mkPresent and mkMinimal

This commit is contained in:
hallgren
2010-11-26 18:49:01 +00:00
parent 52eb1dcc37
commit 4b45cc6b48

View File

@@ -8,6 +8,7 @@ import Distribution.Simple.Setup
import Distribution.PackageDescription hiding (Flag) import Distribution.PackageDescription hiding (Flag)
import Control.Monad import Control.Monad
import Data.Maybe import Data.Maybe
import Data.List(isPrefixOf)
import System.IO import System.IO
import System.Cmd import System.Cmd
import System.FilePath import System.FilePath
@@ -82,8 +83,8 @@ rglCommands =
checkRGLArgs args flags = do checkRGLArgs args flags = do
let args' = filter (\arg -> not (arg == "present" || let args' = filter (\arg -> not (arg == "present" ||
arg == "minimal" || arg == "minimal" ||
take (length rgl_prefix) arg == rgl_prefix || rgl_prefix `isPrefixOf` arg ||
take (length langs_prefix) arg == langs_prefix)) args langs_prefix `isPrefixOf` arg)) args
if null args' if null args'
then return emptyHookedBuildInfo then return emptyHookedBuildInfo
else die $ "Unrecognised flags: " ++ intercalate ", " args' else die $ "Unrecognised flags: " ++ intercalate ", " args'
@@ -225,8 +226,8 @@ gfc mode pkg lbi file = do
let dir = getRGLBuildDir lbi mode let dir = getRGLBuildDir lbi mode
preproc = case mode of preproc = case mode of
AllTenses -> "" AllTenses -> ""
Present -> "-preproc="++(rgl_src_dir </> "mkPresent") Present -> "-preproc="++({-rgl_src_dir </>-} "mkPresent")
Minimal -> "-preproc="++(rgl_src_dir </> "mkMinimal") Minimal -> "-preproc="++({-rgl_src_dir </>-} "mkMinimal")
createDirectoryIfMissing True dir createDirectoryIfMissing True dir
putStrLn $ "Compiling [" ++ show mode ++ "] " ++ file putStrLn $ "Compiling [" ++ show mode ++ "] " ++ file
run_gfc pkg lbi ["-s", preproc, "--gfo-dir="++dir, file] run_gfc pkg lbi ["-s", preproc, "--gfo-dir="++dir, file]