3 ms·
With a bit of creativity, you can achieve most things with the existing GNU make functions. Often the result is far from readable and relies on side-effects lik
by opk 7y ago
With a bit of creativity, you can achieve most things with the existing GNU make functions. Often the result is far from readable and relies on side-effects like sorting removing duplicates. But at least you don't need to worry about make being built with guile support.
Guile does give you access to most system calls. The most interesting thing I've done with this is have the gmake process create a fifo, fork and exec tee in the child process to save a copy of the build output. It doesn't entirely work if gmake re-execs itself after building included makefiles.
I've also tried doing a loadable module in C - to output timing to benchmark changes to my Makefile. I have a non-recursive setup which can take a few seconds at startup.
The guile scripts are mostly limited to running during the initial make stage where dependencies are all gathered. You can't avoid the shell forks during the build process. There are also limitations in the strings being passed back to gmake so it didn't help greatly with colourising output when I tried that.