Skip to content

Commit 9b49097

Browse files
committed
Add makefile
1 parent 354d7f3 commit 9b49097

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
*.gb
3+
*.o
4+
/build

makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
ASM = rgbasm
2+
LINKER = rgblink
3+
FIX = rgbfix
4+
BUILD_DIR = build
5+
OUTPUT_DIR = .
6+
SRC = $(wildcard *.asm)
7+
OBJS = $(SRC:.asm=.o)
8+
9+
GAME_NAME = hello-world
10+
11+
12+
all: build link fix
13+
14+
build:
15+
mkdir $(BUILD_DIR)
16+
$(ASM) -o $(BUILD_DIR)/$(OBJS) $(SRC)
17+
18+
link:
19+
$(LINKER) -o $(OUTPUT_DIR)/$(GAME_NAME).gb $(BUILD_DIR)/$(OBJS)
20+
21+
fix:
22+
$(FIX) -v -p 0 $(OUTPUT_DIR)/$(GAME_NAME).gb
23+
24+
clean:
25+
rm -rf $(BUILD_DIR)

0 commit comments

Comments
 (0)