Question: I am writing inside a `Makefile` and inside this current directory is a folder called `files` with a lot of `.c` files.

I need to get all these `.c` files and store it into a variable called `SOURCES`. How would I do this?

Answer: 
If you can expect your `Makefile` to be used with GNU Make, you can use its [`wildcard` function](https://www.gnu.org/software/make/manual/html_node/Wildcard-Function.html):

```
SOURCES := $(wildcard files/*.c)

```
You can use `$(shell ...)` to put the result of a command into a make variable.

```
SOURCES = $(shell ls files/*.c)

show:
    echo $(SOURCES)

```