-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
83 lines (60 loc) · 1.62 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
export PATH := $(PATH):../tools/cc65/bin
EXT=
ifeq ($(OS),Windows_NT)
EXT=.exe
endif
# Assembler and linker paths
CA = ca65
LD = ld65
# Mapper configuration for linker
NESCFG = nes_001.cfg
# Tool that generates CHR data from Bitmap images
BMP2CHR = bmp2chr$(EXT)
# Tool that generates credits from an input CSV file
GENCRED = generate-credits$(EXT)
# Name of the main source file, minus the extension
NAME = runner
# any CHR files included
CHR = runner_00.chr runner_01.chr credits_00.chr credits_01.chr
# List of all the sources files
SOURCES = $(NAME).asm nes2header.inc game.asm \
background.asm utils.asm utils_ram.asm \
title.asm ded.asm seed.asm scores.asm \
credits.asm credits_ram.asm credits_data.i \
title_trans.asm sound.asm sound_bss.asm \
sound_zp.asm music_data.asm
# misc
RM = rm
TVFORMAT = -D NTSC
.PHONY: clean default cleanSym symbols pal set_pal
default: all
all: bin/$(NAME).nes
names: clrNames credits_data.i bin/$(NAME).nes
clean:
-$(RM) bin/*.* credits_data.i *.chr $(BMP2CHR) $(GENCRED)
clrNames:
-$(RM) credits_data.i
set_pal:
$(eval export TVFORMAT=-D PAL)
pal: set_pal all
bin/:
-mkdir bin
%.chr: %.bmp $(BMP2CHR)
./$(BMP2CHR) -i $< -o $@
$(BMP2CHR): bmp2chr.go
go build bmp2chr.go
$(GENCRED): generate-credits.go
go build generate-credits.go
bin/$(NAME).o: bin/ $(SOURCES) $(CHR)
$(CA) -g \
-t nes \
-o bin/$(NAME).o\
$(TVFORMAT) \
$(NAME).asm
bin/$(NAME).nes: bin/$(NAME).o $(NESCFG)
$(LD) -o bin/$(NAME).nes \
-C $(NESCFG) \
--dbgfile bin/$(NAME).dbg \
bin/$(NAME).o
credits_data.i: $(GENCRED)
./$(GENCRED) -x zorchenhimer -o credits_data.i -i subscriber-list.csv