-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmakefile
More file actions
26 lines (21 loc) · 700 Bytes
/
makefile
File metadata and controls
26 lines (21 loc) · 700 Bytes
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
.POSIX:
.PHONY: all clean
CC=clang
SANITIZERS = -fsanitize=address,leak,undefined
WARNINGS = -Wall -Wextra -Wpedantic \
-Wformat=2 -Wno-unused-parameter -Wshadow \
-Wwrite-strings -Wstrict-prototypes -Wold-style-definition \
-Wredundant-decls -Wnested-externs -Wmissing-include-dirs
# `make DEBUG=1` to enable a sort of dev profile
CFLAGS = -std=c23 -O0 -g $(SANITIZERS) $(WARNINGS)
CFLAGS$(DEBUG) = -std=c23 -O3 -DNDEBUG
all: snake
snake: main.o snake.o window.o map.o term.o
$(CC) $(CFLAGS) -o $@ $^
main.o: main.c snake.h window.h
snake.o: snake.c snake.h
window.o: window.c snake.h term.h window.h
map.o: map.c map.h snake.h term.h window.h
term.o: term.c term.h
clean:
rm -f snake *.o