Sat 31 Dec 2005 03:33:43 PM UTC, original submission:
make is doing something funny in the area of stripping the leading ./ from filenames. I can demonstrate with the following Makefile, which is also attached so you get a copy without whitespace damage.
files := $(shell find . -type f -print)
objects: $(addprefix ./, $(files))
install: $(addprefix /home/andrew/, $(files))
$(addprefix /home/andrew/, $(files)): /home/andrew/%: ./%
true $<
Put this in an empty directory, then create some files, eg
for i in $(seq 1 10); do touch foo$i; done
and run
make install
Output:
true foo1
true foo2
true foo3
true foo4
true ./foo5
true foo6
true foo7
true foo8
true ./foo9
true foo10
true Makefile
Funny, huh? I gave a little attempt to tracking it down. I thought maybe parse_file_seq was at fault, but it seems to give correct results. Then, I looked at the output of
make -r -p install
Looking at the \"Not a target\" entries, I see foo5, ./foo5, and foo4, but no ./foo4. So it seems that for some reason foo5 has an entry under both names and they are aliased in some way. I can\'t imagine why this only afflicts some files.
Also, I noticed that if I comment out the second line of the Makefiles (which defines the unused objects target), the output is:
true ./foo1
true ./foo2
true ./foo3
true ./foo4
true ./foo5
true ./foo6
true ./foo7
true ./foo8
true ./foo9
true ./foo10
true ./Makefile
This seems to be a mostly cosmetic bug, but the aliasing is somewhat worrying.
|