mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-26 03:08:55 -06:00
present version of Make in 1.4
This commit is contained in:
@@ -3,7 +3,7 @@ module Main where
|
|||||||
import System
|
import System
|
||||||
|
|
||||||
-- Make commands for compiling and testing resource grammars.
|
-- Make commands for compiling and testing resource grammars.
|
||||||
-- usage: runghc Make (lang | api | pgf | test | clean)?
|
-- usage: runghc Make present? (lang | api | pgf | test | clean)?
|
||||||
-- 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.
|
||||||
|
|
||||||
@@ -46,25 +46,28 @@ main = do
|
|||||||
make xx = do
|
make xx = do
|
||||||
let ifx opt act = if null xx || elem opt xx then act >> return () else return ()
|
let ifx opt act = if null xx || elem opt xx then act >> return () else return ()
|
||||||
let ifxx opt act = if elem opt xx then act >> return () else return ()
|
let ifxx opt act = if elem opt xx then act >> return () else return ()
|
||||||
|
let pres = elem "present" xx
|
||||||
|
let dir = if pres then "../present" else "../alltenses"
|
||||||
ifx "lang" $ do
|
ifx "lang" $ do
|
||||||
mapM_ (gfc . lang) langsLang
|
mapM_ (gfc pres [] . lang) langsLang
|
||||||
system $ "cp */*.gfo ../alltenses"
|
system $ "cp */*.gfo " ++ dir
|
||||||
ifx "api" $ do
|
ifx "api" $ do
|
||||||
mapM_ (gfc . try) langsAPI
|
mapM_ (gfc pres presApiPath . try) langsAPI
|
||||||
system $ "cp */*.gfo ../alltenses"
|
system $ "cp */*.gfo " ++ dir
|
||||||
ifxx "pgf" $ do
|
ifxx "pgf" $ do
|
||||||
system $ "gfc -s --make --name=langs --parser=off --output-dir=../alltenses " ++
|
system $ "gfc -s --make --name=langs --parser=off --output-dir=" ++ dir ++ " " ++
|
||||||
unwords ["../alltenses/Lang" ++ la ++ ".gfo" | (_,la) <- langsPGF] ++
|
unwords [dir ++ "/Lang" ++ la ++ ".gfo" | (_,la) <- langsPGF] ++
|
||||||
" +RTS -K100M"
|
" +RTS -K100M"
|
||||||
ifxx "test" $ do
|
ifxx "test" $ do
|
||||||
gf treeb $ unwords ["../alltenses/Lang" ++ la ++ ".gfo" | (_,la) <- langsTest]
|
gf treeb $ unwords [dir ++ "/Lang" ++ la ++ ".gfo" | (_,la) <- langsTest]
|
||||||
ifxx "clean" $ do
|
ifxx "clean" $ do
|
||||||
system "rm */*.gfo ../alltenses/*.gfo"
|
system "rm */*.gfo ../alltenses/*.gfo ../present/*.gfo"
|
||||||
return ()
|
return ()
|
||||||
|
|
||||||
gfc file = do
|
gfc pres path file = do
|
||||||
|
let preproc = if pres then " -preproc=./mkPresent " else ""
|
||||||
putStrLn $ "compiling " ++ file
|
putStrLn $ "compiling " ++ file
|
||||||
system $ "gfc -s " ++ file
|
system $ "gfc -s " ++ preproc ++ path ++ file
|
||||||
|
|
||||||
gf comm file = do
|
gf comm file = do
|
||||||
putStrLn $ "reading " ++ file
|
putStrLn $ "reading " ++ file
|
||||||
@@ -78,3 +81,6 @@ try (lla,la) = "api/Try" ++ la ++ ".gf"
|
|||||||
|
|
||||||
except ls es = filter (flip notElem es . snd) ls
|
except ls es = filter (flip notElem es . snd) ls
|
||||||
only ls es = filter (flip elem es . snd) ls
|
only ls es = filter (flip elem es . snd) ls
|
||||||
|
|
||||||
|
presApiPath = " -path=api:present "
|
||||||
|
|
||||||
|
|||||||
1
lib/resource-1.4/mkPresent
Normal file
1
lib/resource-1.4/mkPresent
Normal file
@@ -0,0 +1 @@
|
|||||||
|
grep -v "\-\-\# notpresent" $1
|
||||||
Reference in New Issue
Block a user