[cfe-dev] Getting involved with Clang refactoring

Gregory Szorc gregory.szorc at gmail.com
Wed May 30 11:44:33 PDT 2012


On 5/24/12 5:42 PM, Bill White wrote:
>   I'm working on a python tool to
> extract build information
> from the output of gmake.  (FWIW, I think I have management interest
> in contributing
> my code to clang, or emacs, or whatever my code ends up being useful for.)
>
Having gone down that road myself, you may be interested in PyMake: 
http://benjamin.smedbergs.us/pymake/

It is make implemented in Python. It isn't feature complete, but most of 
it is there. Mozilla uses it to build Firefox, specifically on Windows, 
where the new process overhead of regular make adds significant time to 
builds.

The built-in make functions are implemented as Python methods. And, 
there is even some logic to turn basic rules into in-line Python. Also, 
if your rule begins with a '%' it is converted into a Python function 
call instead of a shell invocation. If you change e.g. CC to '% 
mybuildsystem.compile' you can simply implement the function 'compile' 
in a 'mybuildsystem' module (on sys.path) which can capture the 
arguments, record executing times, etc. It's a pretty nifty backdoor.

If you have any questions, it is arguably off-topic for this list, so 
just ping me on IRC - I'm IndyGreg. Or, join #pymake on irc.mozilla.org 
(I'm gps there).

Gregory



More information about the cfe-dev mailing list