]> cloudbase.mooo.com Git - ddt180.git/blame - Makefile
CPU test. Move relocator to expr buffer.
[ddt180.git] / Makefile
CommitLineData
288de889 1# Build ddt180.com from ddt180.z80
668cf0f7 2
288de889 3PROG := ddt180
668cf0f7
L
4
5SRC := $(PROG).z80
6
7OBJ := $(SRC:.z80=.rel)
8
9AS_OPT := MF
10
11ASM := zxcc slrz80.com
12LINK := zxcc link80.com
13
14.phony: all
15all: $(PROG).com
16
17
18
19$(PROG).com: $(PROG).prl
20 @# Remove the PRL header record (256 bytes)
21 dd status=none bs=256 skip=1 if=$< of=$@
22
23$(PROG).prl: $(OBJ)
24 $(LINK) -'$(PROG)[op,$$SZ]'
25
26
27
28.phony: clean
29clean:
30 rm -f $(PROG).com *.rel *.lst *.prl
31
32.SUFFIXES:
33.SUFFIXES: .z80 .rel .prl
34
35
36define cpm-asm =
37COMMAND="$(ASM) -$(basename $<)/$(AS_OPT)"; \
38OUTPUT=$$(mktemp); echo $${COMMAND}; \
39$${COMMAND} > $${OUTPUT}; \
40grep -q '^ 0 Error(s) Detected' $${OUTPUT}; ERROR=$$? ; \
41if [ "$${ERROR}" != "0" ]; then cat $${OUTPUT}; rm -f $@; fi ; \
42exit $${ERROR}
43endef
44
45%.rel %lst: %.z80
46 @$(cpm-asm)