I'm trying to make a makefile for compiling all the source files in my project, wich are spread in several directories like this:
libc/
arch/
include/
math/
stdio/
And i want to exclude all the files from the arch and include directories, I can do this in the shell using the command ls !(arch)/*.c But when i try to do the same using
$(wildcard !(arch)/*.c)
it doesn't work. How can i make it work in my makefile? Can i use something like !(arch || include) to exclude both directories?
Assuming you're asking about GNU Make, the answer to both questions is no.
The syntax of built-in wildcards in GNU Make is pretty basic:
You can use built-in functions for this kind of task:
Or just shell out to
find
: