-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMakefile_py
83 lines (65 loc) · 2.27 KB
/
Makefile_py
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
# no built-in rules please
.SUFFIXES:
DIR=build
QEMU=
$(info $(shell mkdir -p $(DIR)))
TESTS = fib.asm \
fib_debug.asm \
cmp.asm \
reg_torture.asm \
reg_torture_f32.asm \
fp_op.asm \
multiple_results_f64.asm \
multiple_results_f32.asm \
switch.asm indirect.64.asm \
multiple_results.asm \
memaddr.64.asm \
stack.asm \
int_op.asm \
queens.64.asm \
stack.asm \
pfannkuchen.64.asm
TEST_EXES = $(TESTS:%.asm=$(DIR)/%.asm.exe)
STD_LIB_NO_ARGV = ../StdLib/startup_no_argv.x64.asm ../StdLib/syscall.x64.asm ../StdLib/std_lib.64.asm
STD_LIB_WITH_ARGV = ../StdLib/startup.x64.asm ../StdLib/syscall.x64.asm ../StdLib/std_lib.64.asm
tests: $(DIR)/isel_test \
$(DIR)/syscall.x64.asm.exe \
$(DIR)/cli.x64.asm.exe \
$(TEST_EXES) $(DIR)/nanojpeg
@echo "[OK PY CodeGenX64]"
# flaky
# $(DIR)/threads.x64.asm.exe
# note we sneak in our poor man's std_lib here
$(DIR)/%.asm.exe: ../TestData/%.asm
@echo "[integration $@]"
cat $(STD_LIB_NO_ARGV) $< | $(PYPY) ./codegen.py -mode binary - $@ >$@.out
${QEMU} $@ > $@.actual.out
diff $@.actual.out $<.golden
$(DIR)/isel_test:
@echo "[integration $@]"
$(PYPY) ./isel_tester.py < TestData/codegen_test.asm > $@.actual.out
diff $@.actual.out TestData/codegen_test.asm.golden
$(DIR)/syscall.x64.asm.exe: TestData/syscall.x64.asm
@echo "[integration $@]"
$(PYPY) ./codegen.py -mode binary $< $@
${QEMU} $@ > $@.actual.out
diff $@.actual.out $<.golden
$(DIR)/cli.x64.asm.exe: TestData/cli.x64.asm
@echo "[integration $@]"
cat $(STD_LIB_WITH_ARGV) $< | $(PYPY) ./codegen.py -mode binary - $@ > $@.out
${QEMU} $@ 1 2 3 aa bbb ccc > $@.actual.out
diff $@.actual.out $<.golden
# Flaky see https://github.com/robertmuth/Cwerg/issues/17
# $(DIR)/threads.x64.asm.exe: ../TestData/threads.64.asm
# @echo "[integration $@]"
# cat $(STD_LIB_NO_ARGV) $< | $(PYPY) ./codegen.py -mode binary - $@ > $@.out
# ${QEMU} $@ > $@.actual.out
# diff $@.actual.out $<.golden
$(DIR)/nanojpeg:
@echo "[$@]"
cat $(STD_LIB_WITH_ARGV) ../TestData/nano_jpeg.64.asm | $(PYPY) ./codegen.py -mode binary - $@.exe >$@.out
$@.exe ../TestData/ash_tree.jpg $@.ppm
md5sum $@.ppm > $@.actual
diff $@.actual TestData/nano_jpeg.golden
clean:
rm -f $(DIR)/*