-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (47 loc) · 1.34 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
all: exec
TARGET := gameboyemu
CFLAGS := -g -Wall
OBJECTFILES := build/main.o build/gameboy.o build/cpu.o build/instructions_inlines.o build/instructions.o build/table.o build/memory.o build/cartridge.o build/debugger.o
# Checking
exec: clean linker
@./${TARGET}
# Linking
linker: build debug ${OBJECTFILES}
@echo "Linking objects.."
@g++ -o ${TARGET} ${OBJECTFILES}
# Compiling
build/main.o: src/main.cpp
@echo "Compiling main.."
@g++ ${CFLAGS} -c $< -o $@
build/gameboy.o: src/gameboy.cpp
@echo "Compiling bus.."
@g++ ${CFLAGS} -c $< -o $@
build/cpu.o: src/cpu.cpp
@echo "Compiling cpu.."
@g++ ${CFLAGS} -c $< -o $@
build/instructions.o: src/instructions.cpp
@echo "Compiling instructions.."
@g++ ${CFLAGS} -c $< -o $@
build/instructions_inlines.o: src/instructions_inlines.cpp
@echo "Compiling inlines.."
@g++ ${CFLAGS} -c $< -o $@
build/memory.o: src/memory.cpp
@echo "Compiling memory.."
@g++ ${CFLAGS} -c $< -o $@
build/table.o: src/table.cpp
@echo "Compiling table.."
@g++ ${CFLAGS} -c $< -o $@
build/cartridge.o: src/cartridge.cpp
@echo "Compiling cartridge.."
@g++ ${CFLAGS} -c $< -o $@
build/debugger.o: src/debugger.cpp
@echo "Compiling debugger.."
@g++ ${CFLAGS} -c $< -o $@
# Folder generation
build:
@mkdir $@
debug:
@mkdir $@
# Cleaning
clean:
@rm -rf build