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

How to execute a makefile from LINUX system.

P: n/a
Hi all,
I am using Link-41b parser in my program.
The windows version of it has an .exe file that can be executed using
os.system command
On Linux version,I have a makefile.

so my question is:
How to run the makefile using some python function.

Thanks
Oct 21 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Mon, Oct 20, 2008 at 10:32 PM, gaurav kashyap
<ga***********@gmail.comwrote:
Hi all,
I am using Link-41b parser in my program.
The windows version of it has an .exe file that can be executed using
os.system command
On Linux version,I have a makefile.

so my question is:
How to run the makefile using some python function.
Use the 'subprocess' module
(http://docs.python.org/library/subpr...ule-subprocess) to
run the 'make' command in the same working directory as the Makefile
with the appropriate target as an option.

Cheers,
Chris
--
Follow the path of the Iguana...
http://rebertia.com
>
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
Oct 21 '08 #2

P: n/a
Thanks
Oct 21 '08 #3

P: n/a
gaurav kashyap <ga***********@gmail.comwrites:
How to run the makefile using some python function.
A makefile is not a program to be run; it contains a declarative
(*not* procedural) data set for the ‘make’ program. You need to invoke
the ‘make’ command, tell it which file to read, and specify which
target you want it to achieve.

An example:

$ make -f /tmp/foo/makefile spam

where ‘/tmp/foo/makefile’ is the path to the file containing the data
set, and ‘spam’ is the target you want ‘make’ to achieve.

How do you know which target you want? You'll need that information
from the author of the makefile, such as in the documentation that
comes with the makefile.

--
\ “I put contact lenses in my dog's eyes. They had little |
`\ pictures of cats on them. Then I took one out and he ran around |
_o__) in circles.” —Steven Wright |
Ben Finney
Oct 21 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.