launching a python program from GNU make (Win2K) 
Author Message
 launching a python program from GNU make (Win2K)

From my experience, GNU make has the most features that I want to use.
However, I find it so hard to use under Windows.  For example, I wrote
a small python program that I can launch from the command line and
execute without problems.  I can't seem to launch it from GNU make.  I
have the python program's directory in my PATH and also in my
PYTHONPATH and I added .py to my PATHEXT list.

What could the reason be and how could I fix it?  Does it have
something to do with GNU make going out of it's way to launch sh.exe if
it's on your hard drive, rather than launching command.exe to shell out
processes?  If that is the case, how do I get sh.exe to recognize my
python programs?  Is it the '#!python' thing that the Unix people do?

John

PS Choosing a different make is not an option here.

Sent via Deja.com
http://www.*-*-*.com/



Mon, 02 Jun 2003 04:22:02 GMT  
 launching a python program from GNU make (Win2K)

Quote:

>From my experience, GNU make has the most features that I want to use.
>However, I find it so hard to use under Windows.  For example, I wrote

No kidding :-)

Quote:
>a small python program that I can launch from the command line and
>execute without problems.  I can't seem to launch it from GNU make.  I

We had the same kind of problems, ever since we switched from Novell
to NT servers.
Until the arrival of the latter servers, we had a number of command-line
utils that worked fine within the limits of 'fine' as we know it on W*.

When the Novell server was replaced by an NT server, long filenames
suddenly stopped working, both on the network and locally.
Also, it appeared that 1 command-line program (e.g. GNU-make), could not
start another program (e.g. a compiler), without giving an error of any
kind.
The core of the problem was tracked to the NT server that does not handle
long filenames (even in the 21st century), although they are listed.

I don't know about W2K, but given the fact that it is an NT-based version,
I would not be surprised to see that the situation did not improve.
In fact, I consider command-line oriented programs DEAD on W* systems.

Quote:
>What could the reason be and how could I fix it?  Does it have

I think the reason is W2K. The only fix I know is complain to B.G.
If that would fail for some reason, there are only 2 options left imho.
1) Switch to visual programming (aka do it the MS way),
2) Drop the platform.

FYI: We did the 2nd option.

Quote:
>something to do with GNU make going out of it's way to launch sh.exe if
>it's on your hard drive, rather than launching command.exe to shell out

Nope, it is simply not possible to launch a command-line program from
another command-line program.

Quote:
>PS Choosing a different make is not an option here.

I didn't suggest that :-)

Albert
--
Signature is being repaired, sorry for the inconvenience



Tue, 03 Jun 2003 16:56:39 GMT  
 launching a python program from GNU make (Win2K)

Quote:


> >From my experience, GNU make has the most features that I want to use.
> >However, I find it so hard to use under Windows.  For example, I wrote

> No kidding :-)

> >a small python program that I can launch from the command line and
> >execute without problems.  I can't seem to launch it from GNU make.  I

I have a version of GNU make that I use once in a while on Win32 (all
varieties) that does just fine.  It's a bit older (3.74.4) but I've had no
problems with it.  I don't remember where I got it, but it wasn't part of
the cygwin toolkit but some separate collection of unix-like command line
tools.

I'll send that copy of gmake.exe to anybody that's interested.

Quote:

> >something to do with GNU make going out of it's way to launch sh.exe if
> >it's on your hard drive, rather than launching command.exe to shell out

> Nope, it is simply not possible to launch a command-line program from
> another command-line program.

This is not true.  I do it every day.

--
Robin Dunn
Software Craftsman

http://wxPython.org     Java give you jitters?
http://wxPROs.com        Relax with wxPython!



Wed, 04 Jun 2003 01:15:09 GMT  
 launching a python program from GNU make (Win2K)

Quote:


> >From my experience, GNU make has the most features that I want to use.
> >However, I find it so hard to use under Windows.  For example, I wrote

> No kidding :-)

> >a small python program that I can launch from the command line and
> >execute without problems.  I can't seem to launch it from GNU make.  I

It might be easier to diagnose the problem if you would post the rule
and any relevant variable definitions from the Makefile.

Quote:
> We had the same kind of problems, ever since we switched from Novell
> to NT servers.
> Until the arrival of the latter servers, we had a number of command-line
> utils that worked fine within the limits of 'fine' as we know it on W*.

> When the Novell server was replaced by an NT server, long filenames
> suddenly stopped working, both on the network and locally.
> Also, it appeared that 1 command-line program (e.g. GNU-make), could not
> start another program (e.g. a compiler), without giving an error of any
> kind.

Which version of GNU make?  The Cygwin version works as expected here,
as long as it's set to Unix mode (set MAKE_MODE=unix).  I never tried
to work out how the native mode is supposed to work; Makefiles for
typical Unix software don't work at all in native mode.

Quote:
> The core of the problem was tracked to the NT server that does not handle
> long filenames (even in the 21st century), although they are listed.

I think some other tool is at fault.  If you use the command
interpreter to run any DOS or Win16 programs, it switches into a
compatibility mode where it displays short names to avoid breaking
those programs.  I don't think it's possible to switch back later.

Quote:
> I don't know about W2K, but given the fact that it is an NT-based version,
> I would not be surprised to see that the situation did not improve.
> In fact, I consider command-line oriented programs DEAD on W* systems.

Meanwhile, I'm writing and running command-line programs on Windows
2000 in C, C++, Python and Perl.

Quote:
> >What could the reason be and how could I fix it?  Does it have

> I think the reason is W2K. The only fix I know is complain to B.G.

I think you're falling into Microsoft-bashing mode.

Quote:
> If that would fail for some reason, there are only 2 options left imho.
> 1) Switch to visual programming (aka do it the MS way),
> 2) Drop the platform.

> FYI: We did the 2nd option.

> >something to do with GNU make going out of it's way to launch sh.exe if
> >it's on your hard drive, rather than launching command.exe to shell out

Setting the SHELL to point to cmd.exe might fix this.

Quote:
> Nope, it is simply not possible to launch a command-line program from
> another command-line program.

On what evidence do you base this assertion?

--
Any opinions expressed are my own and not necessarily those of Roundpoint.



Wed, 04 Jun 2003 02:42:17 GMT  
 launching a python program from GNU make (Win2K)
I have the following setup on Win2K:
1. make:
    GNU Make version 3.77, by Richard Stallman and Roland McGrath.
    Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98
            Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
    PARTICULAR PURPOSE.


    I think this is the Mingw version, as I use mingw rather than cygwin.
2. Makefile:
all:
        python test.py
3. test.py:
print "Hello World"

And that works.
Even when I add a #!/bin/python to test.py (which is not the correct
location) and change the makefile line to:
all:
         test.py

it works.
--

URL: http://www.cs.uu.nl/~piet [PGP]



Fri, 06 Jun 2003 23:41:08 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Making GNU lisp 1.0 with GNU cc 2.6.0

2. Making tk8.4a4 with vc++ 6 under Win2k

3. call GNU g++ functions from GNU g77 program

4. Making DLL from a Python program?

5. making a Windows NT service out of a python program

6. Making Reliable Python Programs

7. Launching Python from Python

8. Launching Python debugger from embedded Python

9. making DLL's with gnu-win32

10. help making gnu smalltalk on a next

11. Python Grep (was: writing (Gnu)MAKE in Python)

12. Calling a python program within a python program

 

 
Powered by phpBB® Forum Software