-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathMakefile
82 lines (77 loc) · 2.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
BEEBASM?=beebasm
PYTHON?=python
# A make command with no arguments will build the PAL variant with
# the standard commander and crc32 verification of the game binaries
#
# Optional arguments for the make command are:
#
# variant=<release> Build the specified variant:
#
# pal (default)
# ntsc
#
# commander=max Start with a maxed-out commander
#
# match=no Do not attempt to match the original game binaries
# (i.e. omit workspace noise)
#
# verify=no Disable crc32 verification of the game binaries
#
# So, for example:
#
# make variant=ntsc commander=max match=no verify=no
#
# will build an NTSC variant with a maxed-out commander, no workspace noise
# and no crc32 verification
#
# The following variables are written into elite-build-options.asm depending on
# the above arguments, so they can be passed to BeebAsm:
#
# _VERSION
# 7 = NES
#
# _VARIANT
# 1 = NTSC (default)
# 2 = PAL
#
# _MAX_COMMANDER
# TRUE = Maxed-out commander
# FALSE = Standard commander
#
# _MATCH_ORIGINAL_BINARIES
# TRUE = Match binaries to released version (i.e. fill workspaces with noise)
# FALSE = Zero-fill workspaces
#
# The verify argument is passed to the crc32.py script, rather than BeebAsm
ifeq ($(commander), max)
max-commander=TRUE
else
max-commander=FALSE
endif
ifeq ($(match), no)
match-original-binaries=FALSE
else
match-original-binaries=TRUE
endif
ifeq ($(variant), ntsc)
variant-number=1
folder=ntsc
suffix=-ntsc
else
variant-number=2
folder=pal
suffix=-pal
endif
.PHONY:all
all:
echo _VERSION=7 > 1-source-files/main-sources/elite-build-options.asm
echo _VARIANT=$(variant-number) >> 1-source-files/main-sources/elite-build-options.asm
echo _MATCH_ORIGINAL_BINARIES=$(match-original-binaries) >> 1-source-files/main-sources/elite-build-options.asm
echo _MAX_COMMANDER=$(max-commander) >> 1-source-files/main-sources/elite-build-options.asm
$(BEEBASM) -i 1-source-files/main-sources/elite-source-header.asm -v > 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-source-common.asm -v >> 3-assembled-output/compile.txt
cat 3-assembled-output/header.bin 3-assembled-output/bank0.bin 3-assembled-output/bank1.bin 3-assembled-output/bank2.bin 3-assembled-output/bank3.bin 3-assembled-output/bank4.bin 3-assembled-output/bank5.bin 3-assembled-output/bank6.bin 3-assembled-output/bank7.bin > 3-assembled-output/elite.bin
cp 3-assembled-output/elite.bin 5-compiled-rom-images/ELITE$(suffix).NES
ifneq ($(verify), no)
@$(PYTHON) 2-build-files/crc32.py 4-reference-binaries/$(folder) 3-assembled-output
endif