-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
76 lines (55 loc) · 1.69 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
75
76
IMAGE=ruby-compiler-buildenv
DR=docker run --rm -ti --privileged -v ${PWD}:/app ${IMAGE}
CFLAGS=-g
all: compiler
clean:
@rm -f *~ *.o *.s *\#
@rm -rf doc/
out/driver: *.rb lib/core/*.rb *.c
./compile driver.rb -I . -g
out/driver2: *.rb lib/core/*.rb *.c out/driver
./compile2 driver.rb -I . -g
compiler: out/driver
compiler-nodebug: *.rb lib/core/*.rb *.c
./compile driver.rb -I .
out/driver.l: *.rb
ruby -I. driver.rb -I. --parsetree driver.rb >out/driver.l
hello: compiler
./out/driver examples/hello.rb >out/hello5.s
gcc -m32 -o out/hello5 out/hello5.s out/tgc.o
push:
git push origin master
.PHONY: selftest
# To validate that the test completes under MRI.
# failures under MRI implies the code does something wrong,
selftest-mri:
@echo "== Selftest with MRI:"
${DR} ruby -I. test/selftest.rb
selftest:
./compile test/selftest.rb -I. -g
@echo "== Compiled:"
${DR} ./out/selftest
selftest-c: compiler
./compile2 test/selftest.rb -I. -g
# ./out/driver -I. test/selftest.rb >out/selftest2.s
# gcc -m32 -o out/selftest2 out/selftest2.s out/tgc.o
out/selftest2
# ruby -I. driver.rb --parsetree -I. test/selftest.rb >out/selftest.l
# ./out/driver --parsetree -I. test/selftest.rb >out/selftest2.l
# diff -u out/selftest.l out/selftest2.l | less
valgrind: selftest
${DR} valgrind --track-origins=yes ./out/selftest 2>&1
buildc: Dockerfile
docker build -t ${IMAGE} .
buildc-nocache: Dockerfile
docker build --no-cache -t ${IMAGE} .
cli:
${DR} /bin/bash -l
bundle:
${DR} bundle install
rspec:
${DR} bundle exec rspec --format=doc ./spec/*.rb
.PHONY: features
features:
${DR} /bin/bash -l -c 'cd features; bundle exec cucumber -r. -e inputs -e outputs *.feature'
tests: rspec features selftest