bug-make
[Top][All Lists]
Advanced

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

$(file) function bug or not?


From: Gisle Vanem
Subject: $(file) function bug or not?
Date: Tue, 28 Jan 2014 15:50:51 +0100

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 file.out: $(abspath file.out).'

---------

Running 'make  -f file.mak' gives:
 rm file.out
 abspath file.out: G:/MingW32/src/gnu/GNU-Make/file.out.
 cat file.out
 cat: file.out: No such file or directory
 file.mak:2: recipe for target 'all' failed
 gnumake: *** [all] Error 1

------

(I just used the $(abspath file.out) to verify the file.out gets created).

But without the 'rm file.out', everything works fine:

 #rm file.out
 abspath file.out: G:/MingW32/src/gnu/GNU-Make/file.out.
 cat file.out
  "Hello"
  "world"

Seems GNU-make (or something else) breaks causality here; the docs on the file function (sec. 8.6) has this passage:
 ".. In all cases the file is created if it does not exist."

What is going on here? It doesn't change anything if I do "cat ./file.out'. So I
don't think it's a shell issue.

GNU Make 4.0.90
Built for Windows32 (MSVC)

--gv



reply via email to

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