import Development.Hake import Development.Hake.FunSetRaw targets = [ hello, goodBye ] hello = "hello" goodBye = "good-bye" moduleN = "sayHelloTo" main = hake $ [ dflt targets , ruleSS "" ".o" $ \t s -> [ (".c" , [ [ "gcc", "-o", t ] ++ filter (isSuffixOf ".o") s ]), (".cc", [ [ "g++", "-o", t ] ++ filter (isSuffixOf ".o") s ]) ] , rule ".o" ".c" $ \_ (s:_) -> [ [ "gcc", "-c", s ] ] , rule ".o" ".cc" $ \_ (s:_) -> [ [ "g++", "-c", s ] ] , task "clean" [ [ "rm", "-f" ] ++ concatMap (\s -> [ s, s ++ ".o"]) targets ++ [ moduleN ++ ".o" ] ] ] `addDeps` [ ( hello , [ moduleN ++ ".o" ] ) , ( hello ++ ".o", [ moduleN ++ ".h" ] ) ]