workaround in -opt flag to compile Phrasebook

This commit is contained in:
aarne
2011-12-01 10:35:54 +00:00
parent 205fc859f0
commit 249b391401
2 changed files with 11 additions and 6 deletions

View File

@@ -23,9 +23,10 @@ mainmodu = "Phrasebook"
main = do main = do
(opts,langs) <- getArgs >>= return . partition ((=='-') . head) (opts,langs) <- getArgs >>= return . partition ((=='-') . head)
let modus = [mkFile la | la <- langs] let modus = [mkFile la | la <- langs]
let opt = elem "-opt" opts
putStrLn $ unwords modus putStrLn $ unwords modus
if notElem "-link" opts if notElem "-link" opts
then mapM_ compileOne modus >> return () then mapM_ (compileOne opt) modus >> return ()
else return () else return ()
case opts of case opts of
_ | elem "-make" opts || elem "-link" opts -> do _ | elem "-make" opts || elem "-link" opts -> do
@@ -35,8 +36,9 @@ main = do
return () return ()
_ -> return () _ -> return ()
compileOne modu = do compileOne opt modu = do
let comm = "gf -make -s -optimize-pgf -name=" ++ let optim = if opt then " -optimize-pgf" else ""
comm = "gf -make -s" ++ optim ++ " -name=" ++
modu ++ " " ++ modu ++ ".gf" ++ modu ++ " " ++ modu ++ ".gf" ++
" +RTS -K32M" " +RTS -K32M"
putStrLn comm putStrLn comm

View File

@@ -5,14 +5,17 @@ all: fin demo missing
demo: compdemo linkdemo demo: compdemo linkdemo
compdemo: compdemo:
$(compile) Bul Cat Dan Dut Eng Fre Ger Ita Nor Pol Ron Rus Spa Swe Tha Urd DisambPhrasebookEng $(compile) Bul Dan Dut Nor Pol Ron Spa
$(compile) -opt Cat Eng Fre Ger Rus Swe Tha Urd DisambPhrasebookEng
# $(compile) -opt Bul Cat Dan Dut Eng Fre Ger Ita Nor Pol Ron Rus Spa Swe Tha Urd DisambPhrasebookEng
linkdemo: linkdemo:
$(compile) -link Eng Bul Cat Dan Dut Fin Fre Ger Ita Nor Pol Ron Rus Spa Swe Tha Urd DisambPhrasebookEng $(compile) -link Eng Bul Cat Dan Dut Fin Fre Ger Ita Nor Pol Rus Spa Swe Tha Urd DisambPhrasebookEng
# $(compile) -link Eng Bul Cat Dan Dut Fin Fre Ger Ita Nor Pol Ron Rus Spa Swe Tha Urd DisambPhrasebookEng
#separate, because slow... #separate, because slow...
fin: fin:
$(compile) Fin $(compile) -opt Fin
missing: missing:
echo "pg -missing | wf -file=missing.txt" | gf -run Phrasebook.pgf echo "pg -missing | wf -file=missing.txt" | gf -run Phrasebook.pgf