How to execute a makefile from LINUX system.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gaurav kashyap

    How to execute a makefile from LINUX system.

    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
  • Chris Rebert

    #2
    Re: How to execute a makefile from LINUX system.

    On Mon, Oct 20, 2008 at 10:32 PM, gaurav kashyap
    <gauravkec2005@ 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...

    Comment

    • gaurav kashyap

      #3
      Re: How to execute a makefile from LINUX system.

      Thanks

      Comment

      • Ben Finney

        #4
        Re: How to execute a makefile from LINUX system.

        gaurav kashyap <gauravkec2005@ 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

        Comment

        Working...