$(file) function bug or not?

2014-01-28 Thread Gisle Vanem
I'm trying to understand if my use of the $(file..) function is correct or not. Based on tests/scripts/function/file, I cooked up this little file.mak: all: file_test cat file.out .PHONY: file_test file_test: rm file.out $(file file.out, Hello) $(file file.out, world) @echo 'abspath

Re: $(file) function bug or not?

2014-01-28 Thread Gisle Vanem
Paul Smith psm...@gnu.org wrote: Then make invokes the shell with the results of the expansion, which are the rm and echo commands (and some empty strings which are ignored). So, the rm is running AFTER the file is created, and deleting it. Thanks. That makes sense when I think about it.

Re: $(file) function bug or not?

2014-01-28 Thread David Boyce
On Tue, Jan 28, 2014 at 7:31 AM, Gisle Vanem gva...@yahoo.no wrote: Paul Smith psm...@gnu.org wrote: Then make invokes the shell with the results of the expansion, which are the rm and echo commands (and some empty strings which are ignored). So, the rm is running AFTER the file is created,

Re: $(file) function bug or not?

2014-01-28 Thread Paul Smith
On Tue, 2014-01-28 at 09:52 -0800, David Boyce wrote: I think the headline here is that $(file) is analogous to $(shell) in that it's intended specifically for use _outside_ of recipes. If you find yourself using either one in a recipe it's probably a sign you're on the wrong track. I'm not

Re: $(file) function bug or not?

2014-01-28 Thread David Boyce
On Tue, Jan 28, 2014 at 1:20 PM, Paul Smith psm...@gnu.org wrote: I'm not sure I'd go that far. $(shell ...) really _is_ useless in a recipe because make will invoke a shell to run the recipe anyway, so why have it invoke two shells? It's just redundant. However, $(file ...) can be useful

Re: win32 compilation of make 4.0 source code

2014-01-28 Thread Mark Brown
On Mon, Jan 27, 2014 at 11:05 PM, Mark Brown mkbrown_...@hotmail.com wrote: From: Paul Smith Sent: Monday, January 27, 2014 8:57 PM ... ifneq ($(filter else-if,$(.FEATURES)),else-if) $(error Version $(MAKE_VERSION) does not support else-if) endif Are you saying that this statement can be

Re: win32 compilation of make 4.0 source code

2014-01-28 Thread Philip Guenther
On Tue, 28 Jan 2014, Mark Brown wrote: On Mon, Jan 27, 2014 at 11:05 PM, Mark Brown mkbrown_...@hotmail.com wrote: From: Paul Smith Sent: Monday, January 27, 2014 8:57 PM ... ifneq ($(filter else-if,$(.FEATURES)),else-if) $(error Version $(MAKE_VERSION) does not support