-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
74 lines (61 loc) · 1.58 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
dev: install-production
lm tests/c/c-parse.lsts
cc -O3 tmp.c
./a.out
#lm tests/c/main.c
#cc -O3 tmp.c
#./a.out
build: compile-production
time ./production --c -o deploy1.c SRC/index-index.lm
cc -O3 deploy1.c -o deploy1
time ./deploy1 --c -o deploy2.c SRC/index-index.lm
diff deploy1.c deploy2.c
mv deploy1.c BOOTSTRAP/cli.c
rm -f deploy1 deploy1.c deploy2.c
cargo test regression_tests
deploy: build smoke-test
profile: install-bootstrap
perf record lm SRC/index-index.lm
./report.sh
compile-bootstrap:
rm -f bootstrap
cc -O3 -o bootstrap BOOTSTRAP/cli.c
compile-production: compile-bootstrap
rm -f production
./bootstrap --c -o production.c SRC/index-index.lm
cc -O3 -o production production.c
rm -f production.c
install-production: compile-production
ifeq ($(shell test -w /usr/local/bin; echo $$?), 0)
mv production /usr/local/bin/lm
else
mkdir -p $${HOME}/.local/bin
mv production $${HOME}/.local/bin/lm
endif
install-bootstrap: compile-bootstrap
ifeq ($(shell test -w /usr/local/bin; echo $$?), 0)
mv bootstrap /usr/local/bin/lm
else
mkdir -p $${HOME}/.local/bin
mv bootstrap $${HOME}/.local/bin/lm
endif
smoke-test-clang:
clang BOOTSTRAP/cli.c -o tmp
rm tmp
smoke-test-gcc:
gcc BOOTSTRAP/cli.c -o tmp
rm tmp
smoke-test-musl:
musl-gcc BOOTSTRAP/cli.c -o tmp
rm tmp
smoke-test: smoke-test-clang smoke-test-gcc smoke-test-musl
install:
cc -O3 -o lm BOOTSTRAP/cli.c
ifeq ($(shell test -w /usr/local/bin; echo $$?), 0)
mv lm /usr/local/bin/lm
else
mkdir -p $${HOME}/.local/bin
mv lm $${HOME}/.local/bin/lm
endif
mkdir -p $${HOME}/.lm/
cp -rf PLATFORM $${HOME}/.lm/