-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
184 lines (148 loc) · 7.86 KB
/
Makefile
File metadata and controls
184 lines (148 loc) · 7.86 KB
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
ifeq ($(OS),Windows_NT)
TASS?=tools\64tass.exe
PYTHON?=py -3
else
TASS?=64tass
PYTHON?=python3
endif
##########################################################################
##########################################################################
ifeq ($(VERBOSE),1)
_V:=
_TASSQ:=
else
_V:=@
_TASSQ:=-q
endif
##########################################################################
##########################################################################
DEST:=build
RELEASES:=./releases
DRIVE:=./beeb/0
SHELLCMD:=$(PYTHON) submodules/shellcmd.py/shellcmd.py
##########################################################################
##########################################################################
TASSARGS:=$(_TASSQ) --nostart -Wall --verbose-list --m65xx
TASSCMD:=$(TASS) $(TASSARGS) -Wno-implied-reg --long-branch --case-sensitive
.PHONY:build
build: VER:=$(shell $(SHELLCMD) strftime -d _ '_Y-_m-_d _H:_M:_S')
build: _make_output_folders
$(_V)$(MAKE) _assemble BUILD_TYPE=4 VER= STEM=basiced_type4
$(_V)$(MAKE) _assemble BUILD_TYPE=0 "VER=$(VER)" STEM=basiced
$(_V)$(MAKE) _assemble BUILD_TYPE=1 "VER=$(VER)" STEM=hibasiced
$(_V)$(MAKE) _assemble BUILD_TYPE=8 "VER=$(VER)" STEM=elkbasiced
$(_V)$(MAKE) _assemble BUILD_TYPE=9 "VER=$(VER)" STEM=elkhibasiced
$(_V)$(MAKE) _assemble BUILD_TYPE=2 "VER=$(VER)" STEM=rbasiced
$(_V)$(MAKE) _assemble BUILD_TYPE=3 "VER=$(VER)" STEM=rbasiced2
$(_V)$(MAKE) _copy STEM=basiced DRIVE=$(DRIVE) BBC=R.BETOM
$(_V)$(MAKE) _copy STEM=hibasiced DRIVE=$(DRIVE) BBC=R.HBETOM
$(_V)$(MAKE) _copy STEM=elkbasiced DRIVE=$(DRIVE) BBC=R.EBETOM
$(_V)$(MAKE) _copy STEM=elkhibasiced DRIVE=$(DRIVE) BBC=R.EHBETOM
$(_V)$(MAKE) _copy STEM=basiced_type4 DRIVE=$(DRIVE) BBC=R.BE4TOM
# $(_V)$(MAKE) _copy STEM=rbasiced DRIVE=$(DRIVE) BBC=R.BE4TOMR
$(_V)$(PYTHON) submodules/beeb/bin/tube_relocation.py create -o $(DEST)/rbasiced.relocation.dat $(DEST)/rbasiced.rom $(DEST)/rbasiced2.rom
$(_V)$(SHELLCMD) stat --size-budget=16384 $(DEST)/basiced_.rom $(DEST)/basiced.rom $(DEST)/hibasiced.rom $(DEST)/elkbasiced.rom $(DEST)/elkhibasiced.rom $(DEST)/rbasiced.rom
$(_V)$(SHELLCMD) stat $(DEST)/rbasiced.relocation.dat
$(_V)$(SHELLCMD) sha1 "--ignore=$(VER)" $(DEST)/basiced.rom
##########################################################################
##########################################################################
.PHONY:_make_output_folders
_make_output_folders:
$(_V)$(SHELLCMD) mkdir $(DEST) $(DRIVE)
##########################################################################
##########################################################################
.PHONY:_copy
_copy:
$(_V)$(SHELLCMD) copy-file $(DEST)/$(STEM).rom $(DRIVE)/$(BBC)
##########################################################################
##########################################################################
.PHONY:_assemble
_assemble:
$(_V)$(TASSCMD) -D BUILD_TYPE=$(BUILD_TYPE) -D "VER=\"$(VER)\"" basiced.s65 -L$(DEST)/$(STEM).lst -o$(DEST)/$(STEM).rom -l$(DEST)/$(STEM).sym
##########################################################################
##########################################################################
# This only needs to run on my PC, so it just blithely uses zip, even
# though it isn't included.
.PHONY:release
release: VER=$(error must set VER)
release: _DEST="$(DEST)/$(VER)"
release: _ZIP_Q:=$(if $(VERBOSE),,-q)
release: _ZIP_NAME=basic_editor-$(VER).zip
release: _DIRTY_CHECK_PREFIX:=$(if $(DIRTY_OK),-,)
release:
$(_V)echo Checking for unmodified working copy
$(_DIRTY_CHECK_PREFIX)$(_V)git diff-index --quiet --cached HEAD --
$(_DIRTY_CHECK_PREFIX)$(_V)git diff-files --quiet
$(_V)$(MAKE) clean
$(_V)$(MAKE) build
$(_V)$(SHELLCMD) mkdir "$(_DEST)"
$(_V)$(SHELLCMD) copy-file "$(DEST)/basiced.rom" "$(_DEST)/"
$(_V)$(SHELLCMD) copy-file "$(DEST)/hibasiced.rom" "$(_DEST)/"
$(_V)$(SHELLCMD) copy-file "$(DEST)/elkbasiced.rom" "$(_DEST)/"
$(_V)$(SHELLCMD) copy-file "$(DEST)/elkhibasiced.rom" "$(_DEST)/"
$(_V)$(SHELLCMD) copy-file "$(DEST)/rbasiced.rom" "$(_DEST)/"
$(_V)$(SHELLCMD) copy-file "$(DEST)/rbasiced.relocation.dat" "$(_DEST)/"
$(_V)$(SHELLCMD) copy-file "docs/release_README.md" "$(_DEST)/README.txt"
$(_V)cd "$(_DEST)" && zip -9j $(_ZIP_Q) "../$(_ZIP_NAME)" *
$(_V)echo Release name: $(VER)
$(_V)echo ZIP file: $(shell $(SHELLCMD) realpath "$(_DEST)/../$(_ZIP_NAME)")
##########################################################################
##########################################################################
.PHONY:clean
clean:
$(_V)$(SHELLCMD) rm-tree "$(DEST)"
##########################################################################
##########################################################################
.PHONY:_other_stuff
_other_stuff: _ORIG:=./other/orig
_other_stuff: _make_output_folders
$(_V)$(MAKE) _pres_butils_assemble STEM=butils FLAG=baseds1_version
$(_V)$(MAKE) _pres_butils_assemble STEM=butils2 FLAG=baseds1_all_version
$(_V)$(MAKE) _pres_butils_assemble STEM=butils_elk FLAG=baseds1_elk_version
$(_V)$(MAKE) _pres_butils_assemble STEM=butils_abe FLAG=abe_version
$(_V)$(MAKE) _pres_butils_assemble STEM=butils_bet FLAG=bet_version
$(_V)$(MAKE) _pres_butils_assemble STEM=butils_bet2 FLAG=bet2_version
$(SHELLCMD) cmp "$(DEST)/butils.rom" "./beeb/1/$$.ELECTRON"
$(SHELLCMD) cmp "$(DEST)/butils2.rom" "./beeb/1/$$.ELECTRON2"
# Don't compare butils_elk.rom. It won't match.
$(SHELLCMD) cmp "$(DEST)/butils_abe.rom" "$(_ORIG)/ABE/ABE.0.rom"
$(SHELLCMD) cmp "$(DEST)/butils_bet.rom" "$(_ORIG)/BET/BET.1.rom"
$(SHELLCMD) cmp "$(DEST)/butils_bet2.rom" "$(_ORIG)/BET2/BET2.1.rom"
$(_V)$(MAKE) _other_bedit_assemble STEM=bedit_acornsoft FLAG=release_version
$(SHELLCMD) cmp "$(DEST)/bedit_acornsoft.rom" "./old_releases/1.32_original/basiced.rom"
$(_V)$(MAKE) _other_bedit_assemble STEM=bedit_bet FLAG=bet_version
$(_V)$(MAKE) _other_bedit_assemble STEM=bedit_bet2 FLAG=bet2_version
$(SHELLCMD) cmp "$(DEST)/bedit_bet.rom" "$(_ORIG)/BET/BET.0.rom"
$(SHELLCMD) cmp "$(DEST)/bedit_bet2.rom" "$(_ORIG)/BET2/BET2.0.rom"
$(_V)$(SHELLCMD) concat -o "$(DEST)/BET.32KB.rom" "$(DEST)/bedit_bet.rom" "$(DEST)/butils_bet.rom"
$(SHELLCMD) cmp "$(DEST)/BET.32KB.rom" "$(_ORIG)/BET/BET.32KB.rom"
$(_V)$(MAKE) _other_bedit_assemble STEM=bedit_be FLAG=be_version
$(SHELLCMD) cmp "$(DEST)/bedit_be.rom" "$(_ORIG)/acorn/be"
.PHONY:_other_beditor_assemble
_other_bedit_assemble: STEM=$(error must specify STEM)
_other_bedit_assemble: FLAG=$(error must specify FLAG)
_other_bedit_assemble: _TASS:=$(TASS) $(TASSARGS) -Wno-implied-reg
_other_bedit_assemble:
$(_V)$(_TASS) "./other/bedit/pres_bedit.s65" "-D$(FLAG)=true" "-o$(DEST)/$(STEM).rom" "-L$(DEST)/$(STEM).lst" "-l$(DEST)/$(STEM).sym"
.PHONY:_pres_butils_assemble
_pres_butils_assemble: STEM=$(error must specify STEM)
_pres_butils_assemble: FLAG=$(error must specify FLAG)
_pres_butils_assemble: _TASS:=$(TASS) --case-sensitive $(TASSARGS)
_pres_butils_assemble:
$(_V)$(_TASS) "./other/butils/pres_butils.s65" "-D$(FLAG)=true" "-o$(DEST)/$(STEM).rom" "-L$(DEST)/$(STEM).lst" "-l$(DEST)/$(STEM).sym"
##########################################################################
##########################################################################
.PHONY:_pres_stuff_2
_pres_stuff_2: _make_output_folders
$(_V)$(PYTHON) "submodules/beeb/bin/convert_ddtmass.py" "./beeb/1/$$.!MAKROM" -o "$(DEST)/butils_conv.s65"
$(_V)64tass --case-sensitive -Wall --nostart "$(DEST)/butils_conv.s65" "-o$(DEST)/butils_conv.rom" "-L$(DEST)/butils_conv.lst"
$(SHELLCMD) cmp "$(DEST)/butils_conv.rom" "./beeb/1/$$.ELECTRON2"
##########################################################################
##########################################################################
.PHONY:_tom_emacs
_tom_emacs:
$(_V)$(MAKE) build
$(_V)$(SHELLCMD) blank-line
$(_V)$(MAKE) _other_stuff
$(_V)$(SHELLCMD) blank-line
curl --connect-timeout 0.25 --silent -G 'http://localhost:48075/reset/b2' --data-urlencode "config=BASIC Editor Test"