-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
95 lines (67 loc) · 1.76 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
#
# ASM code requires SDCC and its ASZ80 assembler
# http://sdcc.sourceforge.net/
#
ASZ80 ?= sdasz80 -l
SDCC ?= sdcc -mz80
OBJ ?= obj/
CFLAGS += -Wall
IOPL_LIB=
OS != uname
.if ${OS} == "OpenBSD"
.if ${MACHINE_ARCH} == "amd64"
IOPL_LIB=-lamd64
.elif ${MACHINE_ARCH} == "i386"
IOPL_LIB=-li386
.endif
.endif
all: objdir \
loader.bin codedump.bin datadump.bin memdump.bin dataflashloader.bin \
recvdump sendload tribble_getty
objdir:
@mkdir -p ${OBJ}
clean:
rm -f *.{map,bin,ihx,lst,rel,sym,lk,noi} recvdump sendload \
tribble_getty
# parallel loader
loader.rel: loader.asm
$(ASZ80) -o $@ $>
loader.ihx: loader.rel
$(SDCC) --no-std-crt0 -o $@ $>
loader.bin: loader.ihx
objcopy -Iihex -Obinary $> $@
# dataflash loader
dataflashloader.rel: dataflashloader.asm
$(ASZ80) -o $@ $>
dataflashloader.ihx: dataflashloader.rel
$(SDCC) --no-std-crt0 -o $@ $>
dataflashloader.bin: dataflashloader.ihx
objcopy -Iihex -Obinary $> $@
# parallel dumpers, codeflash and dataflash
codedump.rel: codedump.asm
$(ASZ80) -o $@ $>
codedump.ihx: codedump.rel
$(SDCC) --no-std-crt0 -o $@ $>
codedump.bin: codedump.ihx
objcopy -Iihex -Obinary $> $@
datadump.rel: datadump.asm
$(ASZ80) -o $@ $>
datadump.ihx: datadump.rel
$(SDCC) --no-std-crt0 -o $@ $>
datadump.bin: datadump.ihx
objcopy -Iihex -Obinary $> $@
memdump.rel: memdump.asm
$(ASZ80) -o $@ $>
memdump.ihx: memdump.rel
$(SDCC) --no-std-crt0 -o $@ $>
memdump.bin: memdump.ihx
objcopy -Iihex -Obinary $> $@
# datadump/codedump receiver
recvdump: util/recvdump.c util/tribble.c
$(CC) $(CFLAGS) -o $@ $> $(IOPL_LIB)
# program loader
sendload: util/sendload.c util/tribble.c
$(CC) $(CFLAGS) -o $@ $> $(IOPL_LIB)
# tribble getty
tribble_getty: util/tribble_getty.c util/tribble.c
$(CC) $(CFLAGS) -o $@ $> $(IOPL_LIB) -lutil