-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
43 lines (30 loc) · 818 Bytes
/
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
SRCS = \
cpu/cpu.cpp \
cpu/instruction-set.cpp \
util/byte-type.cpp \
util/bit-register.cpp \
util/thread-util.cpp \
memory/memory.cpp \
video/video.cpp \
main/emu.cpp \
main/window.cpp \
main/main.cpp
OBJS = $(patsubst %.cpp,%.o,$(SRCS))
PROG = gameboy-emu
CC = g++
CFLAGS = -Wall -std=c++11 -O1 -pthread -ggdb -Wno-format
LIBRARY_PATHS = -LD:\Mingw_Lib\lib
INCLUDE_PATHS = -ID:\MinGW_Lib\include\SDL2
LINKER_FLAGS = -lmingw32 -lSDL2main -lSDL2
all: $(PROG)
$(PROG): $(OBJS)
$(CC) $(CFLAGS) -o $(PROG) $^ $(LIBRARY_PATHS) $(LINKER_FLAGS)
%.o: %.cpp
$(CC) $(CFLAGS) -c -o $@ $^ $(INCLUDE_PATHS)
.ONESHELL:
cpu/instruction-set.cpp: cpu/gen-instruction-set.py cpu/instruction-data.json
cd cpu && python gen-instruction-set.py
clean:
rm -f $(OBJS)
rm -f $(PROG)
rm -f cpu/instruction-set.cpp