Tools for working with Cidco Mailstations
1#
2# ASM code requires SDCC and its ASZ80 assembler
3# http://sdcc.sourceforge.net/
4#
5
6ASZ80 ?= sdasz80 -l
7SDCC ?= sdcc -mz80
8
9OBJ ?= obj/
10
11CFLAGS += -Wall
12
13IOPL_LIB=
14
15OS != uname
16
17.if ${OS} == "OpenBSD"
18.if ${MACHINE_ARCH} == "amd64"
19IOPL_LIB=-lamd64
20.elif ${MACHINE_ARCH} == "i386"
21IOPL_LIB=-li386
22.endif
23.endif
24
25all: objdir \
26 loader.bin codedump.bin datadump.bin memdump.bin dataflashloader.bin \
27 recvdump sendload tribble_getty
28
29objdir:
30 @mkdir -p ${OBJ}
31
32clean:
33 rm -f *.{map,bin,ihx,lst,rel,sym,lk,noi} recvdump sendload \
34 tribble_getty
35
36# parallel loader
37loader.rel: loader.asm
38 $(ASZ80) -o $@ $>
39
40loader.ihx: loader.rel
41 $(SDCC) --no-std-crt0 -o $@ $>
42
43loader.bin: loader.ihx
44 objcopy -Iihex -Obinary $> $@
45
46# dataflash loader
47dataflashloader.rel: dataflashloader.asm
48 $(ASZ80) -o $@ $>
49
50dataflashloader.ihx: dataflashloader.rel
51 $(SDCC) --no-std-crt0 -o $@ $>
52
53dataflashloader.bin: dataflashloader.ihx
54 objcopy -Iihex -Obinary $> $@
55
56
57# parallel dumpers, codeflash and dataflash
58codedump.rel: codedump.asm
59 $(ASZ80) -o $@ $>
60
61codedump.ihx: codedump.rel
62 $(SDCC) --no-std-crt0 -o $@ $>
63
64codedump.bin: codedump.ihx
65 objcopy -Iihex -Obinary $> $@
66
67datadump.rel: datadump.asm
68 $(ASZ80) -o $@ $>
69
70datadump.ihx: datadump.rel
71 $(SDCC) --no-std-crt0 -o $@ $>
72
73datadump.bin: datadump.ihx
74 objcopy -Iihex -Obinary $> $@
75
76memdump.rel: memdump.asm
77 $(ASZ80) -o $@ $>
78
79memdump.ihx: memdump.rel
80 $(SDCC) --no-std-crt0 -o $@ $>
81
82memdump.bin: memdump.ihx
83 objcopy -Iihex -Obinary $> $@
84
85# datadump/codedump receiver
86recvdump: util/recvdump.c util/tribble.c
87 $(CC) $(CFLAGS) -o $@ $> $(IOPL_LIB)
88
89# program loader
90sendload: util/sendload.c util/tribble.c
91 $(CC) $(CFLAGS) -o $@ $> $(IOPL_LIB)
92
93# tribble getty
94tribble_getty: util/tribble_getty.c util/tribble.c
95 $(CC) $(CFLAGS) -o $@ $> $(IOPL_LIB) -lutil