Wed 06 Oct 2004 02:31:27 PM UTC, original submission:
Hi,
I believe I may have found a bug with GNU Make version 3.80...
SUMMARY:
There seems to be an issue with GNU Make in that it fails to search in VPATH for a prerequisite file that is specified in the commands section by its name (or a variable containing its name).
TO RECREATE THE BEHAVIOUR:
1) touch /tmp/file.c
2) mkdir /tmp/testing
3) cd /tmp/testing
4) Create a Makefile containing the following:
VPATH = /tmp
file = file.c
file.o : $(file)
ls -l $(file)
5) Run, "make".
You will get the output:
ls -l file.c
ls: file.c: No such file or directory
make: *** [file.o] Error 1
The error occurs because "file.c" does not exist in
/tmp/testing/. But surely GNU Make should find it, since VPATH is set to allow it to find the file, and the file it needs is indeed a prerequisite file.
WORK-AROUND:
To rectify the situation, change the Makefile so that it contains:
VPATH = /tmp
file = file.c
file.o : $(file)
ls -l $<
You will then get output similar to this:
ls -l /tmp/file.c
-rw-r----- 1 jdhunt jdhunt 0 Oct 6 15:08 /tmp/file.c
ADDITIONAL:
It also seems that GNU Make will not search in VPATH for "$@". Also, it will not search VPATH for "include" files.
Whatever happens with this bug, please could the excellent GNU Make manual be updated WRT VPATH: more examples would be useful.
ENVIRONMENT:
My system is running Fedora Core 2. "make --version" returns:
GNU Make 3.80
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
rpm -q make returns:
make-3.80-3
|