Hi Theodore,
My alternative question would be "what's wrong with that way?". I use
that strategy in the Ninja and Makefile interpreters built into Shake,
see
http://neilmitchell.blogspot.co.uk/2014/01/running-makefiles-with-shake.html
or
http://neilmitchell.blogspot.co.uk/2014/05/shake-as-dependency-library.html
. As long as processing the Makefile is sufficiently quick not to
matter (which it usually is) then you are basically writing an
interpreter for your custom build syntax using Shake, which works
nicely.
If you really want to avoid that approach, or if for some reason you
can't use that approach (e.g. the Makefile itself is a dependency)
then you can probably use newCache in some way to store the output of
the Makefile, see
https://github.com/ndmitchell/ghc-make/blob/master/Build.hs, in
particular the "makefile" rule and call to newCache, combined with
addOracle. However, that approach is trickier to get right, almost
forces a level of indirection, and you have to pin down some details
about how generate_rules works in advance. In some ways
usingConfigFile from
http://hackage.haskell.org/package/shake/docs/Development-Shake-Config.html#v:usingConfigFile
is a good example of the Oracle/Cache pattern.
Thanks, Neil