I have two files as below (from tree command).
.
|-- Makefile
|-- dir1
| `-- file1.c
`-- dir2
`-- file2.c
I wanted to compiles files in dir1 and dir2 directory so I wrote a Makefile as below.
VPATH = dir1:dir2
CFILES := ${wildcard *.v}
$(info CFILES = ${CFILES})
output :
CFILES =
So the wildcar function doesn't automatically search paths set by the VPATH variable.
If I specifically write the path in the wildcard function, it works.
CFILES := ${wildcard dir1/*.c dir2/*.c} <== this makes it work
$(info CFILES = ${CFILES})
output :
CFILES = dir1/file1.c dir2/file2.c
I want to add only the existing paths to the Makefile but is there any way that I can use wildcard function for paths set by VPATH? (Suppose I need to remove some files from compile list so I need the files list. Just curious..)