-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
36 lines (27 loc) · 779 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
# 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 = matrix-rain
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
all: create_build_dir $(OUTPUT)
create_build_dir:
mkdir -p $(BUILD_DIR)
$(OUTPUT): $(OBJECTS)
$(LINK) -m $@.map -o $@.gb -n $@.sym $(OBJECTS)
$(FIX) $(FIX_FLAGS) $@.gb
build/%.obj: src/%.asm
$(ASM) -I$(INCDIR)/ -o$@ $<
clean:
rm -rf $(BUILD_DIR)/*