Added 'parse' target to Make.hs.

This commit is contained in:
bjorn
2008-11-03 12:29:28 +00:00
parent 759d648de9
commit dfd2adad09
7 changed files with 12 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ import System.Exit
-- Make commands for compiling and testing resource grammars.
-- usage: runghc Make ((present? OPT?) | (clone FILE))? LANGS?
-- where
-- - OPT = (lang | api | math | pgf | test | demo | clean)
-- - OPT = (lang | api | math | pgf | test | demo | parse | clean)
-- - LANGS has the form e.g. langs=Eng,Fin,Rus
-- - clone with a flag file=FILENAME clones the file to the specified languages,
-- by replacing the 3-letter language name of the original in both
@@ -61,6 +61,9 @@ langsTest = langsLang `except` ["Ara","Bul","Cat","Hin","Rus","Spa","Tha"]
-- languages for which to run demo test
langsDemo = langsLang `except` ["Ara","Hin","Ina","Tha"]
-- languages for which to compile parsing grammars
langsParse = langs `only` ["Eng"]
-- languages for which langs.pgf is built
langsPGF = langsTest `only` ["Eng","Fre","Swe"]
@@ -104,6 +107,9 @@ make xx = do
ifxx "demo" $ do
let ls = optl langsDemo
gf (demos "Demo" ls) $ unwords ["demo/Demo" ++ la ++ ".gf" | (_,la) <- ls]
ifxx "parse" $ do
mapM_ (gfc pres [] . parse) (optl langsParse)
copy "parse/*.gfo" dir
ifxx "clean" $ do
system "rm -f */*.gfo ../alltenses/*.gfo ../present/*.gfo"
ifxx "clone" $ do
@@ -137,6 +143,7 @@ compat (lla,la) = lla ++ "/Compatibility" ++ la ++ ".gf"
symbol (lla,la) = lla ++ "/Symbol" ++ la ++ ".gf"
try (lla,la) = "api/Try" ++ la ++ ".gf"
symbolic (lla,la) = "api/Symbolic" ++ la ++ ".gf"
parse (lla,la) = "parse/Parse" ++ la ++ ".gf"
except ls es = filter (flip notElem es . snd) ls
only ls es = filter (flip elem es . snd) ls

View File

@@ -3,7 +3,7 @@ RUNMAKE=$(RUNGHC) Make.hs
GF_LIB_PATH=..
.PHONY: all present alltenses lang api math prelude test demo synopsis link compiled constructX clean
.PHONY: all present alltenses lang api math prelude test demo parse synopsis link compiled constructX clean
all: link prelude constructX present alltenses compat
@@ -38,6 +38,9 @@ test:
demo:
$(RUNMAKE) demo
parse:
$(RUNMAKE) parse
synopsis:
cd doc ; $(RUNGHC) MkSynopsis ; cd ..