By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,665 Members | 1,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,665 IT Pros & Developers. It's quick & easy.

Parsing a makefile using Python

P: n/a
I'm interested in parsing a (simple) Makefile using Python. I need to
write a packager for a program I'm supporting, and would like to read
the list of files in the makefile so that I only have to update that
list once.

That is, I have a statement (actually multiple statements) in the
Makefile that looks like:

FILES = a.f b.f c.c d.py e.c \
f.f g.f h.c

and would like a standard way of parsing this. Being able to include
references to other definitions in the makefile, such as

FILES2 = $(FILES) i.f

would be nice as well.

I found an old reference to a post on this topic:
http://groups.google.com/group/comp....f9fc21e3bf32c2
that suggested the distutils could do this, but I haven't found
anything in the documentation for the distutils.
Any suggestions?

Thanks in advance,

Rick

Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.