-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (31 loc) · 853 Bytes
/
Copy pathMakefile
File metadata and controls
38 lines (31 loc) · 853 Bytes
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
# ============================================================================
# NES ROM Build System
# ============================================================================
#
# Build pipeline:
# 1. ca65 (assembler): hello.asm → hello.o (object file)
# 2. ld65 (linker): hello.o + nes.cfg → hello.nes (final ROM)
#
# Usage:
# make - Build the ROM
# make clean - Remove build artifacts
# The assembler and linker
ASM = ca65
LINK = ld65
# Source files
SRC = hello.asm
CFG = nes.cfg
CHR = assets/chr/megaman_sprites.chr
# Output files
OBJ = hello.o
ROM = hello.nes
# Build the ROM
$(ROM): $(OBJ)
$(LINK) -o $(ROM) -C $(CFG) $(OBJ)
# Assemble the source (depends on CHR binary included via .incbin)
$(OBJ): $(SRC) $(CHR)
$(ASM) -o $(OBJ) $(SRC)
# Clean up build artifacts
clean:
rm -f $(OBJ) $(ROM)
.PHONY: clean