FAQ
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

Search Discussions

  • Chris Rebert at Oct 21, 2008 at 6:03 am

    On Mon, Oct 20, 2008 at 10:32 PM, gaurav kashyap wrote:
    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/subprocess.html#module-subprocess) to
    run the 'make' command in the same working directory as the Makefile
    with the appropriate target as an option.

    Cheers,
    Chris
  • Gaurav kashyap at Oct 21, 2008 at 6:14 am
    Thanks
  • Ben Finney at Oct 21, 2008 at 6:43 am

    gaurav kashyap <gauravkec2005 at gmail.com> writes:

    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedOct 21, '08 at 5:32a
activeOct 21, '08 at 6:43a
posts4
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase