summaryrefslogtreecommitdiff
path: root/Makefile
blob: f6d01c73e56ebcf8381acd90a1bd7bcaa439af93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
name=core

CFLAGS= -g \
	$(shell pkg-config --cflags sdl3) \
	$(pkg-config --cflags sdl3-ttf)

LDFLAGS= \
	$(shell pkg-config --libs sdl3) \
	$(shell pkg-config --libs sdl3-ttf)

srcs=$(shell find src -name '*.c')
objs=$(srcs:%.c=build/%.o)
deps=$(objs:.o=.d)

./build/$(name): $(objs)
	$(CC) $(objs) -o $@ $(LDFLAGS)

./build/%.o: %.c
	mkdir -p $(dir $@)
	$(CC) $(CFLAGS) -MMD -MP -c $< -o $@

.PHONY: clean
clean:
	rm -rf build

-include $(deps)