-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (52 loc) · 1.06 KB
/
Copy pathMakefile
File metadata and controls
65 lines (52 loc) · 1.06 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
CC := gcc
PKG_CONFIG := pkg-config
TARGET := bin/cecosystem
SRC := $(wildcard src/*.c)
OBJ := $(patsubst src/%.c,build/%.o,$(SRC))
DEP := $(OBJ:.o=.d)
WARNINGS := \
-Wall \
-Wextra \
-Wpedantic \
-Wshadow \
-Wconversion \
-Wsign-conversion \
-Wcast-qual \
-Wwrite-strings \
-Wformat=2 \
-Wundef \
-Wstrict-prototypes \
-Wold-style-definition \
-Wimplicit-fallthrough \
-Wlogical-op \
-Wcast-align \
-Wvla \
-Wnull-dereference \
-Wdouble-promotion \
-Wformat-overflow=2 \
-Wformat-truncation=2 \
-Walloc-zero \
-Warray-bounds=2 \
-Wstringop-overflow=4 \
-Wstrict-overflow=5 \
-Wswitch-enum \
-Wpointer-arith \
-Winit-self
CFLAGS := -std=c11 -g $(WARNINGS)
CFLAGS += -Iinclude
CFLAGS += $(shell $(PKG_CONFIG) --cflags raylib)
LDLIBS := $(shell $(PKG_CONFIG) --libs raylib)
.PHONY: all clean run rebuild
all: $(TARGET)
$(TARGET): $(OBJ)
@mkdir -p $(@D)
$(CC) $(OBJ) -o $@ $(LDLIBS)
build/%.o: src/%.c
@mkdir -p $(@D)
$(CC) $(CFLAGS) -MMD -MP -c $< -o $@
-include $(DEP)
run: $(TARGET)
./$(TARGET)
clean:
rm -rf build bin
rebuild: clean all