help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems running certain utilities via makefile (Win32)


From: Eli Zaretskii
Subject: Re: problems running certain utilities via makefile (Win32)
Date: Fri, 04 Dec 2015 11:34:19 +0200

> Date: Thu, 3 Dec 2015 15:12:36 -0800 (PST)
> From: Gorlash <address@hidden>
> 
> I have been using makefiles for many years, but have historically had
> problems running certain win32 executables via it, though the same command
> works fine in a batch file.  One of my more common problem applications is
> lint-nt.exe, from PcLint.  Here is a typical command:
> 
> c:\lint9\lint-nt +v -width(160,4) $(LiFLAGS) +fcp -ic:\lint9 mingw.lnt
> -os(_lint.tmp) lintdefs.cpp $(CPPSRC)
> 
> If I try to run this explicitly, it fails with:
> 
> c:\lint9\lint-nt +v -width(160,4)  +fcp -ic:\lint9 mingw.lnt -os(_lint.tmp)
> lintdefs.cpp json_handler.cpp common_funcs.cpp nsort.cpp
> /bin/sh: -c: line 0: syntax error near unexpected token `('
> /bin/sh: -c: line 0: `c:\lint9\lint-nt +v -width(160,4)  +fcp -ic:\lint9
> mingw.lnt -os(_lint.tmp) lintdefs.cpp json_handler.cpp common_funcs.cpp
> nsort.cpp '
> Makefile:42: recipe for target 'lintraw' failed
> make: *** [lintraw] Error 258
> 
> (note that the macros expanded properly, and that the resulting command
> works fine from cmd.exe)

How did /bin/sh come into play here?  Do you have some sh.exe
somewhere on your PATH?  If so, you need to protect any characters
special for a Unixy shell by escaping them or by quoting.

> In the past, I used Cygwin make, and with that program I could instead spawn
> the command in cmd.exe using:
>       cmd /c "c:\lint9\lint-nt +v -width(160,4) $(LiFLAGS) +fcp -ic:\lint9
> mingw.lnt -os(_lint.tmp) lintdefs.cpp $(CPPSRC)"
> 
> and that worked fine.  Recently, though, I've switched to using GnuWin32,
> but the preceding command fails with:
> C:\SourceCode\json Yes, Master?? > make lint
> cmd /c "c:\lint9\lint-nt +v -width(160,4)  +fcp -ic:\lint9 mingw.lnt
> -os(_lint.tmp) lintdefs.cpp json_handler.cpp common_funcs.cpp nsort.cpp "
> Microsoft Windows [Version 6.1.7601]
> Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
> 
> and then it leaves me sitting in this sub-shell, without doing anything.

GnuWin32 provides an old, buggy port of an old version of GNU Make.
Don't use it.

> So, at this point, I can't find any way to run this command from a
> makefile!!  I even downloaded Make V4.1 and build using MinGW, but that
> didn't help any.

Please show the results of running your Makefile with Make 4.1.  If
you need, you can find precompiled binaries here:

  
http://sourceforge.net/projects/ezwinports/files/make-4.1-2-without-guile-w32-bin.zip/download
  
http://sourceforge.net/projects/ezwinports/files/make-4.1-2-with-guile-w32-bin.zip/download

(choose one of these 2 builds).

> Is there some technique to solve this problem, whatever it is??

Pc-Lint is a proprietary package, so I cannot test it here.  But it
sounds like the problem is with some Unixy shell lying on your Windows
PATH.  One thing to try is to remove the directory with sh.exe from
your PATH; Make 4.1 should then invoke cmd.exe by default, which will
probably work much better.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]