Why MAKEFLAGS is set to `w' in sub directory?

2016-03-14 Thread Masato Asou
Hello, Why MAKEFLAGS is set to `w' in sub directory? When I invoke make command in sub directory. Then MAKEFLAGS is not set. $ cd sub $ make !!! Debug: MAKEFLAGS = However, I invoke make command in parent directory, then MAKEFLAGS is set to `w' in sub directory. $ cd .. $ m

Re: Why MAKEFLAGS is set to `w' in sub directory?

2016-03-14 Thread Paul Smith
On Mon, 2016-03-14 at 18:13 +0900, Masato Asou wrote: > Why MAKEFLAGS is set to `w' in sub directory? Because that's how it's documented to work. See "The '--print -directory' Option" in the GNU make manual: Normally, you do not need to specify this option because ‘make’ does it for you:

$(file ...) function and other tools writing to the same file

2016-03-14 Thread Martin Reinders
Hello, I am experiencing unexpected results if both the $(file ...) function (that was introduced with GNU make version 4) and other command-line utilities are used to produce a single file. Here is a minimal example. (The "echo" command is used for demonstration purposes, it stands for any exter

Re: $(file ...) function and other tools writing to the same file

2016-03-14 Thread Paul Smith
On Mon, 2016-03-14 at 14:32 +0100, Martin Reinders wrote: > $ cat Makefile > all: > /bin/echo "LINE FROM ECHO COMMAND" > file.txt > $(file >>file.txt,LINE FROM FILE FUNCTION) > I expected that the echo command writes one line to the file, and the > $(file ...) function appends

Re: $(file ...) function and other tools writing to the same file

2016-03-14 Thread Martin Reinders
On 14.03.16 14:43, Paul Smith wrote: > On Mon, 2016-03-14 at 14:32 +0100, Martin Reinders wrote: >> $ cat Makefile >> all: >> /bin/echo "LINE FROM ECHO COMMAND" > file.txt >> $(file >>file.txt,LINE FROM FILE FUNCTION) > >> I expected that the echo command writes one line to the

Re: $(file ...) function and other tools writing to the same file

2016-03-14 Thread Tim Murphy
On 14 March 2016 at 13:32, Martin Reinders wrote: > Hello, > > I am experiencing unexpected results if both the $(file ...) function > (that was introduced with GNU make version 4) and other command-line > utilities are used to produce a single file. > > Here is a minimal example. (The "echo" com

Re: $(file ...) function and other tools writing to the same file

2016-03-14 Thread Tim Murphy
On 14 March 2016 at 14:55, Martin Reinders wrote: > On 14.03.16 14:56, Tim Murphy wrote: > > Functions and variables are expanded before the command and list of > > variables is sent to the shell to be executed. Hence $(file) happens > > before your echo command is executed. > > That makes sense

Re: $(file ...) function and other tools writing to the same file

2016-03-14 Thread Martin Reinders
On 14.03.16 14:56, Tim Murphy wrote: > Functions and variables are expanded before the command and list of > variables is sent to the shell to be executed. Hence $(file) happens > before your echo command is executed. That makes sense now, thank you very much. > Why would you use $(file) in a co

Re: $(file ...) function and other tools writing to the same file

2016-03-14 Thread Stephan Beal
On Mon, Mar 14, 2016 at 4:11 PM, Tim Murphy wrote: > That's a great reason for wanting to do that. I certainly think it would be > immensely useful if make had some sort of very limited shell that would > allow x-platform makefiles to be created without a lot of ifdefs or special > variables. >

make VAR+=VAL

2016-03-14 Thread ??????
Hi Guys, I saw GNU make (I am using 3.8.1) allows the usage of 'make VAR+=VAL' command line, but it does not append VAL to VAR and instead it overrides VAR to VAL. Is this expected behavior? I did not find any doc explaining the usage of VAR+=VAL on command line. Thanks, Justin ___

Re: Why MAKEFLAGS is set to `w' in sub directory?

2016-03-14 Thread Masato Asou
From: Paul Smith Date: Mon, 14 Mar 2016 09:35:22 -0400 > On Mon, 2016-03-14 at 18:13 +0900, Masato Asou wrote: >> Why MAKEFLAGS is set to `w' in sub directory? > > Because that's how it's documented to work. See "The '--print > -directory' Option" in the GNU make manual: > ‘--no-print-dire