-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
83 lines (69 loc) · 1.73 KB
/
Makefile
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
CORE := \
src/core/apu.c \
src/core/bus.c \
src/core/cpu.c \
src/core/irq.c \
src/core/joypad.c \
src/core/lcd.c \
src/core/mbc.c \
src/core/rtc.c \
src/core/serial.c \
src/core/timer.c
LIB := \
src/lib/endian.c \
src/lib/filter.c \
src/lib/hash.c \
src/debug.c \
src/init.c \
src/io.c \
src/savefile.c \
src/testing.c
SDL2 := \
src/shell/sdl2/main.c \
src/shell/sdl2/audio.c \
src/shell/sdl2/video.c \
src/shell/sdl2/input.c \
src/shell/sdl2/file.c
SRC := $(CORE) $(LIB) $(SDL2)
OBJ := $(SRC:.c=.o)
CFLAGS += -O2 -Wall -Werror -Wextra -I include/
CFLAGS += $(shell sdl2-config --cflags)
LDFLAGS += -O2 -lm $(shell sdl2-config --libs)
all: gbmu
gbmu: $(OBJ)
$(CC) -o $@ $^ $(LDFLAGS)
clean:
$(RM) $(OBJ)
fclean: clean
$(RM) gbmu
re: fclean all
tidy: $(SRC) include/*.h
clang-tidy $^ -checks=-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling -- $(CFLAGS)
format:
astyle -A14 \
--mode=c \
--break-one-line-headers \
--break-blocks \
--align-pointer=name \
--convert-tabs \
--pad-header \
--unpad-paren \
--add-braces \
--max-code-length=80 \
--break-after-logical \
--delete-empty-lines \
--indent-continuation=1 \
--lineend=linux \
--suffix=none \
$(SRC) include/*.h webrtc/*.c webrtc/*.h
tests: gbmu
./tests/mealybug.sh > tests/mealybug.results.csv
./tests/mooneye.sh acceptance > tests/acceptance.results.csv
./tests/mooneye.sh emulator-only > tests/emulator-only.results.csv
./tests/blargg1.sh > tests/blargg1.results.csv
./tests/blargg2.sh > tests/blargg2.results.csv
tests-gambatte: gbmu
./tests/gambatte.sh div > tests/gambatte-div.results.csv
./tests/gambatte.sh tima > tests/gambatte-tima.results.csv
./tests/gambatte.sh serial > tests/gambatte-serial.results.csv
.PHONY: tests