```
"*.asm.o" %> \out -> do
let src = dropExtension out
need [src]
cmd "as" [src] "-o" [out]
```
Removing corresponding .asm file will still leave compiled version around.
Now suppose this rule explains how to make .hi and .o files from .hs file and .hs file gets removed after compilation. ghc will still try to load it when using separate compilation if module with the same name still exists in a library.
How do I find and remove those files without reimplementing half of dependency tracking mechanism in a build system or without removing whole building tree?
That is pretty much exactly what I'm looking for. Thanks a lot!
"it will build all files, then delete all stale files"
Hmm... Nope, not going to work. It fails to compile when there are stale files.
I think what I want is a relatively cheap way asking "Can we build this?". Not sure if it's possible though.