The hake package
Like ruby's rake, hake have Hakefile which is Haskell source.
And Hakefile is like rake's Rakefile, and make's Makefile.
Hakefile is just Haskell source code, then you can use all Haskell features.
import Development.Hake
hake_rules = [
dflt [ "greeting" ]
,
file ( [ "greeting", "greeting.log" ], [ "hello.o", "good-bye.o" ] ,
[ "linker -o greeting hello.o good-bye.o" ] )
,
rule ( ".o", ".sfx1",
\t s -> [ "compiler1 " ++ s ++ " -o " ++ t ] )
,
rule ( ".o", ".sfx2",
\t s -> [ "compiler2 " ++ s ++ " -o " ++ t ] )
,
task ( "clean" , [ "rm -f *.o greeting greeting.log" ] )
,
mkfl ( "script.sh", [ "#!/bin/sh", "echo This is script", "echo made by Hakefile" ] )
,
mkfl2 ( "script.sh", [ "script.sh.gen" ], \[s] ->
do gen <- readFile s
return $ [ "#!/bin/sh", "echo This is script", "echo made by Hakefile" ]
++ gen )
,
ruleSS ( "", ".o", \t s -> [ (".c", [ "gcc " ++ s ++ " -o " ++ t ] ) ,
(".cc", [ "g++ " ++ s ++ " -o " ++ t ] ) ] )
,
rule ( ".o", ".c", \_ s -> [ "gcc -c " ++ s ] )
,
rule ( ".o", ".cc", \_ s -> [ "g++ -c " ++ s ] )
,
( [ (=="foo") ], const [ "foo.gen", "Hakefile" ], \t [s] -> [ do
gen <- liftIO $ readFile s
liftIO $ writeFile t $ unlines $
[ "#!/bin/sh", "echo This is script" ] ++ lines gen ] )
]
main = hake hake_rules
Properties
| Versions | 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.9.5, 0.9.9, 1.0, 1.1, 1.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6 |
|---|---|
| Dependencies | base, directory, mtl, old-time, process, yjtools (>0.1) |
| License | GPL |
| Author | Yoshikuni Jujo |
| Maintainer | Yoshikuni Jujo <PAF01143@nifty.ne.jp> |
| Stability | experimental |
| Category | Development |
| Home page | http://homepage3.nifty.com/salamander/second/projects/hake/index.xhtml |
| Executables | hake |
| Upload date | Sun Oct 26 08:53:30 UTC 2008 |
| Uploaded by | YoshikuniJujo |
| Built on | ghc-6.8 |
| Build failure | ghc-6.10 (log), ghc-6.12 (log) |
Modules
- Development
Downloads
- hake-0.4.tar.gz (Cabal source package)
- package description (included in the package)