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
_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make