-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
89 lines (67 loc) · 1.98 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
# TR-DOS disassembled Makefile
# Author: Marcos Cruz (programandala.net), 2016, 2017
# This file is part of
# TR-DOS disassembled
# http://programandala.net/
# Last modified 201702102225
################################################################
# Requirements
# z80dasm by Tomaž Šolc. It's included in Debian and other Linux
# distros, and can be obtained from its author's website:
# https://www.tablix.org/~avian/z80dasm/
# http://www.tablix.org/~avian/git/#z80dasm
# Vim by Bram Moolenaar
# http://vim.org
# Pasmo by Julián Albo
# http://pasmo.speccy.org
# diffutils by Paul Eggert, Mike Haertel, David Hayes, Richard
# Stallman, and Len Tower.
# http://www.gnu.org/software/diffutils/
################################################################
# History
# See at the end of the file.
################################################################
# Config
MAKEFLAGS = --no-print-directory
# .ONESHELL:
################################################################
.PHONY: all
all: trdos.z80s
.PHONY: clean
clean:
rm -f trdos.raw.z80s trdos.z80s trdos.reassembled.rom
.PHONY: back
back: trdos.reassembled.rom
trdos.raw.z80s: \
trdos.symbols.input.z80s \
trdos.blocks.txt \
inc/*.z80s
z80dasm \
--origin=0x0000 \
--address \
--labels \
--source \
--block-def=trdos.blocks.txt \
--sym-input=trdos.symbols.input.z80s \
--sym-output=trdos.symbols.output.z80s \
--output=$@ \
trdos.rom
trdos.z80s: trdos.raw.z80s tools/tidier.vim
vim -e -R -n -S tools/tidier.vim $<
trdos.reassembled.rom: trdos.z80s
pasmo $< $@
diff -s trdos.rom $@
################################################################
# Change history
# 2016-08-14: Start.
#
# 2016-08-19: Add after-processing with Vim.
#
# 2016-08-20: Add assembling of the disassembled source, as a
# check.
#
# 2016-10-01: Add `diff` check to the reassembled ROM; formerly
# a manual check was done with VBinDiff.
#
# 2017-02-10: Add the generic symbols files as prerequisites of
# the raw disassembly.