How to Convert a makefile to Python Script

Discussion in 'Python' started by rkoida@yahoo.com, Apr 20, 2005.

  1. Guest

    Hello All
    I am working on a Problem to convert makefile in to a python script.
    Are there any Modules? Please try to comment.

    Thanks
    rkoida
     
    , Apr 20, 2005
    #1
    1. Advertising

  2. On 19 Apr 2005 20:49:31 -0700, wrote:

    >Hello All
    > I am working on a Problem to convert makefile in to a python script.
    >Are there any Modules? Please try to comment.
    >
    >Thanks
    >rkoida
    >

    IIUC, the scons project came to be to implement make functionality in python,
    so I'd try to find someone there to ask. They must have thought about it a lot.

    http://www.scons.org/

    Regards,
    Bengt Richter
     
    Bengt Richter, Apr 20, 2005
    #2
    1. Advertising

  3. Guest

    Thanks For Your Help

    Regards
    rkoida
     
    , Apr 20, 2005
    #3
  4. Nick Vargish Guest

    writes:

    > I am working on a Problem to convert makefile in to a python script.
    > Are there any Modules? Please try to comment.


    How about this (untested):

    -------- cut here --------
    import subprocess

    print ("import os")
    make = subprocess.Popen(["make", "-n"],stdout=subprocess.PIPE)
    makeout = make.communicate()[0]
    for l in makeout.split('\n'):
    print 'os.system("%s")' % l.replace('"', '\"')
    -------- cut here --------

    The quote escaping replace() might not be quite right, but you get
    what I'm suggesting, right? To mangle a lwall quote, "The only
    substitute for make is make."

    Nick

    --
    # sigmask (lambda deprecation version) 20041028 || feed this to a python
    print ''.join([chr(ord(x)-1) for x in 'Ojdl!Wbshjti!=ojdlAwbshjti/psh?'])
     
    Nick Vargish, Apr 20, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave
    Replies:
    9
    Views:
    16,843
    RichardShepherd
    Jan 1, 2012
  2. Dave
    Replies:
    7
    Views:
    571
    Phlip
    Aug 10, 2004
  3. Replies:
    1
    Views:
    737
  4. fl
    Replies:
    2
    Views:
    435
    88888 Dihedral
    Dec 24, 2011
  5. NewBie

    Makefile - perl script syntax error

    NewBie, Aug 24, 2005, in forum: Perl Misc
    Replies:
    1
    Views:
    137
    Josef Moellers
    Aug 24, 2005
Loading...

Share This Page