shake-0.10.9: Build system library, like Make, but more accurate dependencies.

Safe HaskellNone

Development.Shake.Util

Description

A module for useful utility functions for Shake build systems.

Synopsis

Documentation

parseMakefile :: String -> [(FilePath, [FilePath])]Source

Given the text of a Makefile, extract the list of targets and dependencies. Assumes a small subset of Makefile syntax, mostly that generated by gcc -MM.

 parseMakefile "a: b c\nd : e" == [("a",["b","c"]),("d",["e"])]

needMakefileDependencies :: FilePath -> Action ()Source

Depend on the dependencies listed in a Makefile. Does not depend on the Makefile itself.

 needMakefileDependencies file = need . concatMap snd . parseMakefile =<< liftIO (readFile file)

neededMakefileDependencies :: FilePath -> Action ()Source

Depend on the dependencies listed in a Makefile. Does not depend on the Makefile itself. Use this function to indicate that you have already used the files in question.

 neededMakefileDependencies file = needed . concatMap snd . parseMakefile =<< liftIO (readFile file)