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: Gorlash
Subject: Re: problems running certain utilities via makefile (Win32)
Date: Fri, 4 Dec 2015 10:13:11 -0800 (PST)

Okay, here are runs using your make.exe, with two different run styles:
'make lint' runs with the 'cmd /c' wrapper, 'make lintraw' just runs the
program itself.  Both still fail, as shown below.

BTW, the sh.exe that make is picking up, is in \git\bin; I cannot really
delete that, since git uses it for other purposes.  What would be desirable
would be if make would spawn processes using OS methods such as exec(),
rather than trying to spawn sub-shells in the Unix style...

ITM, in most cases I'd be quite happy to use the 'cmd /c' wrapper; this
used to work with cygwin make (which is also V4.1), but as you can see,
with your make (or GnuWin32, or UnxUtils), it spawns cmd.exe but does not
seem to pass my command to that shell, so nothing happens.

C:\SourceCode\json Yes, Master?? > which make
make is an external : C:\utility\make.exe

C:\SourceCode\json Yes, Master?? > make --version
GNU Make 4.1
Built for Windows32
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

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.

address@hidden@color 10 on 1 & echos %_cwd & color 13 on 0 & echos  Yes, 
Master??
& color 3 on 0] > exit

C:\SourceCode\json Yes, Master?? > *make lintraw*
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:43: recipe for target 'lintraw' failed
make: *** [lintraw] Error 258





On Fri, Dec 4, 2015 at 1:18 AM, Eli Zaretskii [via Gnu - Make] <
address@hidden> wrote:

> > Date: Thu, 3 Dec 2015 15:12:36 -0800 (PST)
> > From: Gorlash <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=16741&i=0>>
> >
> > 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.
>
> _______________________________________________
> Help-make mailing list
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=16741&i=1>
> https://lists.gnu.org/mailman/listinfo/help-make
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://gnu-make.2324884.n4.nabble.com/problems-running-certain-utilities-via-makefile-Win32-tp16736p16741.html
> To unsubscribe from problems running certain utilities via makefile
> (Win32), click here
> <http://gnu-make.2324884.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=16736&code=ZG1pbGxlckB2aXRhbGNvbm5lY3QuY29tfDE2NzM2fC01MDg3MTY3NzY=>
> .
> NAML
> <http://gnu-make.2324884.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://gnu-make.2324884.n4.nabble.com/problems-running-certain-utilities-via-makefile-Win32-tp16736p16742.html
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.


reply via email to

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