mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
added new Makefile in the top directory which calls Cabal for compilation
This commit is contained in:
24
Makefile
Normal file
24
Makefile
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
.PHONY: all gf install doc clean sdist lib
|
||||||
|
|
||||||
|
all: gf lib
|
||||||
|
|
||||||
|
dist/setup-config:
|
||||||
|
runghc Setup.lhs configure
|
||||||
|
|
||||||
|
gf: dist/setup-config
|
||||||
|
runghc Setup.lhs build
|
||||||
|
|
||||||
|
install:
|
||||||
|
runghc Setup.lhs install
|
||||||
|
|
||||||
|
doc:
|
||||||
|
runghc Setup.lhs haddock
|
||||||
|
|
||||||
|
clean:
|
||||||
|
runghc Setup.lhs clean
|
||||||
|
|
||||||
|
sdist:
|
||||||
|
runghc Setup.lhs sdist
|
||||||
|
|
||||||
|
lib:
|
||||||
|
$(MAKE) -C lib/resource clean all
|
||||||
@@ -19,7 +19,7 @@ import System.Exit
|
|||||||
-- With no argument, lang and api are done, in this order.
|
-- With no argument, lang and api are done, in this order.
|
||||||
-- See 'make' below for what is done by which command.
|
-- See 'make' below for what is done by which command.
|
||||||
|
|
||||||
default_gfc = "../../bin/gfc"
|
default_gf = "../../dist/build/gf/gf"
|
||||||
|
|
||||||
presApiPath = "-path=api:present"
|
presApiPath = "-path=api:present"
|
||||||
|
|
||||||
@@ -175,21 +175,15 @@ unlexer abstr ls =
|
|||||||
where
|
where
|
||||||
unlex lla = maybe "" id $ lookup lla langsCoding
|
unlex lla = maybe "" id $ lookup lla langsCoding
|
||||||
|
|
||||||
-- | Runs the gfc executable with the given arguments.
|
-- | Runs the gf executable in compile mode with the given arguments.
|
||||||
run_gfc :: [String] -> IO ()
|
run_gfc :: [String] -> IO ()
|
||||||
run_gfc args =
|
run_gfc args =
|
||||||
do p <- liftM (fromMaybe default_gfc) $ findExecutable "gfc"
|
do let args' = ["-batch","-gf-lib-path=../"] ++ filter (not . null) args ++ ["+RTS"] ++ rts_flags ++ ["-RTS"]
|
||||||
env <- getEnvironment
|
putStrLn $ "Running: " ++ default_gf ++ " " ++ unwords (map showArg args')
|
||||||
case lookup "GF_LIB_PATH" env of
|
e <- rawSystem default_gf args'
|
||||||
Nothing -> putStrLn "$GF_LIB_PATH is not set."
|
case e of
|
||||||
Just _ ->
|
ExitSuccess -> return ()
|
||||||
do let args' = filter (not . null) args ++ ["+RTS"] ++ rts_flags ++ ["-RTS"]
|
ExitFailure i -> putStrLn $ "gf exited with exit code: " ++ show i
|
||||||
cmd = p ++ " " ++ unwords (map showArg args')
|
|
||||||
putStrLn $ "Running: " ++ cmd
|
|
||||||
e <- system cmd
|
|
||||||
case e of
|
|
||||||
ExitSuccess -> return ()
|
|
||||||
ExitFailure i -> putStrLn $ "gfc exited with exit code: " ++ show i
|
|
||||||
where rts_flags = ["-K100M"]
|
where rts_flags = ["-K100M"]
|
||||||
showArg arg = "'" ++ arg ++ "'"
|
showArg arg = "'" ++ arg ++ "'"
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ math:
|
|||||||
$(RUNMAKE) math
|
$(RUNMAKE) math
|
||||||
|
|
||||||
compat:
|
compat:
|
||||||
gfc */Compatibility*.gf
|
gf -batch */Compatibility*.gf
|
||||||
cp -p */Compatibility*.gfo ../alltenses/
|
cp -p */Compatibility*.gfo ../alltenses/
|
||||||
cp -p */Compatibility*.gfo ../present/
|
cp -p */Compatibility*.gfo ../present/
|
||||||
# $(RUNMAKE) present compat
|
# $(RUNMAKE) present compat
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import System.Exit
|
|||||||
-- With no argument, lang and api are done, in this order.
|
-- With no argument, lang and api are done, in this order.
|
||||||
-- See 'make' below for what is done by which command.
|
-- See 'make' below for what is done by which command.
|
||||||
|
|
||||||
default_gfc = "../../bin/gfc"
|
default_gf = "../../dist/build/gf/gf"
|
||||||
|
|
||||||
presApiPath = "-path=api:present"
|
presApiPath = "-path=api:present"
|
||||||
presSymbolPath = "-path=.:abstract:present:common:romance:scandinavian" ----
|
presSymbolPath = "-path=.:abstract:present:common:romance:scandinavian" ----
|
||||||
@@ -195,21 +195,15 @@ unlexer abstr ls =
|
|||||||
where
|
where
|
||||||
unlex lla = maybe "" id $ lookup lla langsCoding
|
unlex lla = maybe "" id $ lookup lla langsCoding
|
||||||
|
|
||||||
-- | Runs the gfc executable with the given arguments.
|
-- | Runs the gf executable in compile mode with the given arguments.
|
||||||
run_gfc :: [String] -> IO ()
|
run_gfc :: [String] -> IO ()
|
||||||
run_gfc args =
|
run_gfc args =
|
||||||
do p <- liftM (fromMaybe default_gfc) $ findExecutable "gfc"
|
do let args' = ["-batch","-gf-lib-path=."] ++ filter (not . null) args ++ ["+RTS"] ++ rts_flags ++ ["-RTS"]
|
||||||
env <- getEnvironment
|
putStrLn $ "Running: " ++ default_gf ++ " " ++ unwords (map showArg args')
|
||||||
case lookup "GF_LIB_PATH" env of
|
e <- rawSystem default_gf args'
|
||||||
Nothing -> putStrLn "$GF_LIB_PATH is not set."
|
case e of
|
||||||
Just _ ->
|
ExitSuccess -> return ()
|
||||||
do let args' = filter (not . null) args ++ ["+RTS"] ++ rts_flags ++ ["-RTS"]
|
ExitFailure i -> putStrLn $ "gf exited with exit code: " ++ show i
|
||||||
cmd = p ++ " " ++ unwords (map showArg args')
|
|
||||||
putStrLn $ "Running: " ++ cmd
|
|
||||||
e <- system cmd
|
|
||||||
case e of
|
|
||||||
ExitSuccess -> return ()
|
|
||||||
ExitFailure i -> putStrLn $ "gfc exited with exit code: " ++ show i
|
|
||||||
where rts_flags = ["-K100M"]
|
where rts_flags = ["-K100M"]
|
||||||
showArg arg = "'" ++ arg ++ "'"
|
showArg arg = "'" ++ arg ++ "'"
|
||||||
|
|
||||||
|
|||||||
@@ -25,15 +25,15 @@ compat:
|
|||||||
$(RUNMAKE) present compat
|
$(RUNMAKE) present compat
|
||||||
|
|
||||||
prelude:
|
prelude:
|
||||||
gfc prelude/*.gf
|
gf -batch prelude/*.gf
|
||||||
cp -p prelude/*.gfo ../prelude
|
cp -p prelude/*.gfo ../prelude
|
||||||
|
|
||||||
constructX:
|
constructX:
|
||||||
gfc common/ConstructX.gf
|
gf -batch common/ConstructX.gf
|
||||||
cp -p common/ConstructX.gfo ../prelude
|
cp -p common/ConstructX.gfo ../prelude
|
||||||
|
|
||||||
MakeStructural:
|
MakeStructural:
|
||||||
gfc */MakeStructural*.gf
|
gf -batch */MakeStructural*.gf
|
||||||
cp -p */MakeStructural*.gfo ../present
|
cp -p */MakeStructural*.gfo ../present
|
||||||
cp -p */MakeStructural*.gfo ../alltenses
|
cp -p */MakeStructural*.gfo ../alltenses
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user