-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
74 lines (60 loc) · 2 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
# Read the PORT variable
include config.mk
all: x86
arduino:
$(MAKE) -C src
arduino-sim:
$(MAKE) -C src
if [ ! -d simavr ] ; then \
git submodule init || exit 1 ; \
git submodule update || exit 1 ; \
$(MAKE) -C simavr/examples/board_simduino/ ; \
fi
cd src ; ./simduino
upload:
$(MAKE) -C src upload
@echo -e "Issue '\e[1mmake terminal\e[0m' to communicate over ${PORT}"
terminal:
picocom -c -b 115200 --imap lfcrlf ${PORT}
x86:
$(MAKE) -C src_x86
clean:
$(MAKE) -C src clean
rm -f src_x86/x86_forth
extract-forth-code:
@cat README.md \
| sed '1,/My Forth test/d' \
| grep '^ ' \
| grep -v OK \
| sed 's,^ ,,'
test-address-sanitizer:
$(MAKE) -C src_x86
@$(MAKE) extract-forth-code \
| grep -v '^make' \
| ./src_x86/x86_forth
test-valgrind:
$(MAKE) -C src_x86 valgrind
@$(MAKE) extract-forth-code \
| grep -v '^make' \
| valgrind ./src_x86/x86_forth
@echo "[-] Test PASSED."
test-arduino:
@$(MAKE) extract-forth-code \
| grep -v '^make' > testing/scenario
testing/test_forth.py -p ${PORT} -i testing/scenario
blink-arduino:
testing/test_forth.py -p ${PORT} -i testing/blinky.fs
test-simulator:
$(MAKE) -C src
if [ ! -d simavr ] ; then \
git submodule init || exit 1 ; \
git submodule update || exit 1 ; \
$(MAKE) -C simavr/examples/board_simduino/ ; \
fi
cd src ; ./simduino-test
@$(MAKE) extract-forth-code \
| grep -v '^make' > testing/scenario
testing/test_forth.py -p /tmp/simavr-uart0 -i testing/scenario
@killall simduino.elf
test:
$(MAKE) test-address-sanitizer