E pur si muove

Compiling applications in

Monday, May 11, 2009

If you need to compile a random application in this is not that hard:

cc = distutils.ccompiler.new_compiler()
cc.link_executable(['test.c'], 'a.out')

There is no need to create the object files explicitly with cc.compile() first if you have no need for them, the command line invoked by .link_executable() will do the compilation step in one go for you.

This part of distutils is actually documented, so check it out, you can pass in many optional arguments and modify the compiler object to customize things.


New comments are not allowed.

Subscribe to: Post Comments (Atom)