blob: 03de33b9121190b726ebade127f4769d9536edfb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
CC := gcc
CFLAGS := -Wall -Wextra -std=c11 -O2
LDFLAGS :=
SOURCES := $(wildcard src/*.c)
HEADERS := $(wildcard src/*.h)
TARGETS := $(patsubst src/%.c,bin/%,$(SOURCES))
.PHONY: all clean
all: $(TARGETS)
clean:
rm -f $(TARGETS)
$(TARGETS): bin/%: src/%.c $(HEADERS)
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) -o $@ $<
|