summaryrefslogtreecommitdiff
path: root/Maakbestand
blob: e760b655cab8365306196294dee0fd6ecaf6b970 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
CC := gcc
CFLAGS := -Wall -Wextra -std=c11 -O2
LDFLAGS :=

OBJDIR := obj
TARGET := drukkedoos

SOURCES := $(shell find src -type f -name '*.c')
HEADERS := $(shell find src -type f -name '*.h')
OBJECTS := $(patsubst src/%.c,obj/%.o,$(SOURCES))

.PHONY: all clean

all: $(TARGET)

clean:
	rm -rf $(OBJDIR) $(TARGET)

$(TARGET): main.c $(OBJECTS)
	$(CC) -o $@ $^ $(LDFLAGS)

$(OBJECTS): obj/%.o: src/%.c $(HEADERS)
	$(CC) $(CFLAGS) -c -o $@ $<