-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
136 lines (129 loc) · 5.67 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
BEEBASM?=beebasm
PYTHON?=python
# A make command with no arguments will build the Stairway to Hell variant
# with encrypted binaries, checksums enabled, the standard commander and
# crc32 verification of the game binaries
#
# Optional arguments for the make command are:
#
# variant=<release> Build the specified variant:
#
# sth (default)
# ib-disc
# sideways-ram
#
# commander=max Start with a maxed-out commander
#
# encrypt=no Disable encryption and checksum routines
#
# 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=ib-disc commander=max encrypt=no match=no verify=no
#
# will build an unencrypted Ian Bell disc 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
# 2 = BBC Micro disc
#
# _VARIANT
# 1 = Ian Bell's game disc
# 2 = Stairway to Hell (default)
# 3 = BBC Micro Sideways RAM version
#
# _MAX_COMMANDER
# TRUE = Maxed-out commander
# FALSE = Standard commander
#
# _REMOVE_CHECKSUMS
# TRUE = Disable checksum routines
# FALSE = Enable checksum routines
#
# _MATCH_ORIGINAL_BINARIES
# TRUE = Match binaries to released version (i.e. fill workspaces with noise)
# FALSE = Zero-fill workspaces
#
# The encrypt and verify arguments are passed to the elite-checksum.py and
# crc32.py scripts, rather than BeebAsm
ifeq ($(commander), max)
max-commander=TRUE
else
max-commander=FALSE
endif
ifeq ($(encrypt), no)
unencrypt=-u
remove-checksums=TRUE
else
unencrypt=
remove-checksums=FALSE
endif
ifeq ($(match), no)
match-original-binaries=FALSE
else
match-original-binaries=TRUE
endif
ifeq ($(variant), ib-disc)
variant-number=1
folder=ib-disc
suffix=-ib-disc
boot=-boot ELITE2
else ifeq ($(variant), sideways-ram)
variant-number=3
folder=sideways-ram
suffix=-sideways-ram
boot=-opt 3
else
variant-number=2
folder=sth
suffix=-sth
boot=-boot ELITE2
endif
.PHONY:all
all:
echo _VERSION=2 > 1-source-files/main-sources/elite-build-options.asm
echo _VARIANT=$(variant-number) >> 1-source-files/main-sources/elite-build-options.asm
echo _REMOVE_CHECKSUMS=$(remove-checksums) >> 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-text-tokens.asm -v > 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-missile.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-loader1.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-loader2.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-loader3.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-loader-sideways-ram.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-source-flight.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-source-docked.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-ships-a.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-ships-b.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-ships-c.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-ships-d.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-ships-e.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-ships-f.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-ships-g.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-ships-h.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-ships-i.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-ships-j.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-ships-k.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-ships-l.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-ships-m.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-ships-n.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-ships-o.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-ships-p.asm -v >> 3-assembled-output/compile.txt
$(BEEBASM) -i 1-source-files/main-sources/elite-readme.asm -v >> 3-assembled-output/compile.txt
$(PYTHON) 2-build-files/elite-checksum.py $(unencrypt) -rel$(variant-number)
$(BEEBASM) -i 1-source-files/main-sources/elite-disc.asm -do 5-compiled-game-discs/elite-disc$(suffix).ssd $(boot) -title "E L I T E"
ifneq ($(verify), no)
@$(PYTHON) 2-build-files/crc32.py 4-reference-binaries/$(folder) 3-assembled-output
endif
.PHONY:b2
b2:
curl -G "http://localhost:48075/reset/b2"
curl -H "Content-Type:application/binary" --upload-file "5-compiled-game-discs/elite-disc$(suffix).ssd" "http://localhost:48075/run/b2?name=elite-disc$(suffix).ssd"