Makefile I/O module?

Donn Cave donn at oz.net
Sat Jun 2 00:34:34 EDT 2001


Quoth Bob Drzyzgula <bob at drzyzgula.org>:
| Does anyone know of a module providing classes for parsing
| standard makefiles, sort of like what the rfc822 module
| does for mail messages?  I don't want to actually do the
| make logic in Python, I just want to be able to filter
| and assemble makefile fragments and templates into output
| makefiles for later processing by make itself; I'm trying
| to write a GUI configuration utility for a package with
| tons of options.

Like,
    from distutils import sysconfig
    sysconfig.parse_makefile('Makefile')
?

I don't know if that will really do what you want, as it
returns only the symbol assignments when I do it, but at
worst it's a start.  Python uses it to understand its own
Makefile, to build itself (2.1 does not shrink from paradox.)

	Donn Cave, donn at oz.net



More information about the Python-list mailing list