-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (41 loc) · 1.11 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
# clang++ -S -mllvm --x86-asm-syntax=intel test.cc
CXX=clang++-5.0
CXXFLAGS=-O3 -Wall -Werror -std=c++1z -m32
AS=sdasz80
ASFLAGS=-xlos -g
LD=sdcc
LDFLAGS=-mz80 --no-std-crt0 --nostdlib --code-loc 0x8032 --data-loc 0x8200 -Wl -b_HEADER=0x8000
OUT=out
all: $(OUT)/app.tap
%.tap: %.bin
appmake +zx --binfile $< --org 32768
$(OUT)/app.bin: $(OUT)/game.rel $(OUT)/crt0.rel
cd $(@D); \
$(LD) $(LDFLAGS) $(^F); \
makezxbin <game.ihx >$(@F)
%.rel: %.z80
$(AS) $(ASFLAGS) $@ $<
$(OUT)/crt0.rel: crt0.s
@mkdir -p $(@D)
$(AS) $(ASFLAGS) $@ $<
$(OUT)/game.z80: $(OUT)/game.s $(OUT)/x86z80
@mkdir -p $(@D)
$(OUT)/x86z80 -in $< -out $@
$(OUT)/%.s: %.cc
@mkdir -p $(@D)
$(CXX) $(CXXFLAGS) -S -mllvm --x86-asm-syntax=intel $< -o $@
$(OUT)/x86z80: ./go/x86z80.go
@mkdir -p $(@D)
go build -o $@ ./go
run: $(OUT)/app.tap
fuse-gtk --tap $< \
--interface1 --interface2 \
--kempston --kempston-mouse \
--machine 48 --graphics-filter hq2x \
# --debugger-command "br 0x8000"
test: $(OUT)/x86z80 ./go/x86z80_test.go
go test ./go
$< -in test.asm -out $(OUT)/test.z80
clean:
-@rm -r $(OUT)
.PHONY: clean run test all