This is a kind of silly question, but this is first time I am using Makefile
.
I am having trouble with selecting files. When I used this command,
target1:
$(CC) -o target *.c
it worked well. But this doesn't work,
SRCS = dir1/*.c
target1:
$(CC) -o target $(SRCS)
and spits this error.
clang: error: no such file or directory: 'dir1/*.c'
Obviously this because my variable SRCS
is escaped before passed.
How can I make Makefile pass the string as is? Or is there another conventional/designed way to do this? (selecting file by pattern)