-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (32 loc) · 982 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
# Use make -B due to the fact that .inc changes are not getting tracked
# in dependencies.
# Not yet sure how to utilize rgbasm -M (https://rednex.github.io/rgbds/rgbasm.1.html#M)
# to resolve.
ASM = rgbasm
LINK = rgblink
FIX = rgbfix
ROM_NAME = game-of-life
SRC_DIR = src
INC_DIR = include
BUILD_DIR = build
SOURCES = $(foreach dir,$(SRC_DIR),$(wildcard $(dir)/*.asm))
FIX_FLAGS = -v -p0
OUTPUT = $(BUILD_DIR)/$(ROM_NAME)
INCDIR = include
OBJECTS = $(SOURCES:src/%.asm=build/%.obj)
.PHONY: all clean
MODE = 0 # default to game mode
test1 : MODE = 1 # test mode 1
test2 : MODE = 2 # test mode 2
test3 : MODE = 3 # test mode 3
test4 : MODE = 4 # test mode 4
all test1 test2 test3 test4: create_build_dir $(OUTPUT)
create_build_dir:
mkdir -p $(BUILD_DIR)
$(OUTPUT): $(OBJECTS)
$(FIX) $(FIX_FLAGS) [email protected]
build/%.obj: src/%.asm
$(ASM) -D mode=$(MODE) -I$(INCDIR)/ -o$@ $<
clean:
rm -rf $(BUILD_DIR)/*