forked from Lambda-Mountain-Compiler-Backend/lambda-mountain
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
114 lines (92 loc) · 2.97 KB
/
Copy pathMakefile
File metadata and controls
114 lines (92 loc) · 2.97 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
CC = clang
CFLAGS = -w -O2 -march=native -mtune=native -fbracket-depth=1000
LSTSFLAGS = MALLOC_CHECK_=3
# WARNING: You may need to increase ulimit
# the compiler stack frames are currently fairly fat and inefficient
# recursion is used fairly heavily
# recommendation: ulimit -s unlimited
dev:
lm tests/promises/backend/render-blob.lsts
gcc tmp.c
./a.out
echo $?
build: compile-production
time env $(LSTSFLAGS) ./production -o deploy1.c SRC/index.lsts
$(CC) $(CFLAGS) deploy1.c -o deploy1
time env $(LSTSFLAGS) ./deploy1 -o deploy2.c SRC/index.lsts
diff deploy1.c deploy2.c
mv deploy1.c BOOTSTRAP/cli.c
rm -f deploy1 deploy1.c deploy2.c
cargo test regression_tests
gperf: install-bootstrap
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libprofiler.so CPUPROFILE=out.prof lm SRC/index.lsts
google-pprof --text /home/andrew/.local/bin/lm out.prof > profile_results.txt
deploy: build smoke-test
deploy-lite: build smoke-test-lite
gprofng: install-bootstrap
gprofng collect app lm SRC/index.lsts
gprofng-view:
gprofng display text -functions test.1.er > gprofng.view
nano gprofng.view
valgrind: install-production
valgrind --tool=callgrind lm SRC/index.lsts
valgrind-view:
callgrind_annotate callgrind.out.18778
gprof:
$(CC) $(CFLAGS) -pg -o bootstrap.exe BOOTSTRAP/cli.c
$(LSTSFLAGS) ./bootstrap.exe SRC/index.lsts
gprof-view-count:
gprof bootstrap.exe gmon.out | less
gprof-view-call-graph:
gprof -q bootstrap.exe gmon.out
profile: install-bootstrap
perf record lm SRC/index.lsts
./report.sh
compile-bootstrap:
cat lib/core/*.lsts SRC/*.lsts PLUGINS/*/*/*.lsts > BOOTSTRAP/monolithic.lsts
rm -f bootstrap.exe
$(CC) $(CFLAGS) -o bootstrap.exe BOOTSTRAP/cli.c
compile-production: compile-bootstrap
rm -f production
$(LSTSFLAGS) time ./bootstrap.exe -o production.c SRC/index.lsts
$(CC) $(CFLAGS) -o production production.c
rm -f production.c
install-production: compile-production
ifeq ($(shell test -w /usr/local/bin; echo $$?), 0)
cp production /usr/local/bin/lm-production
mv production /usr/local/bin/lm
else
mkdir -p $${HOME}/.local/bin
cp production $${HOME}/.local/bin/lm-production
mv production $${HOME}/.local/bin/lm
endif
install-bootstrap: compile-bootstrap
ifeq ($(shell test -w /usr/local/bin; echo $$?), 0)
cp bootstrap.exe /usr/local/bin/lm-bootstrap
mv bootstrap.exe /usr/local/bin/lm
else
mkdir -p $${HOME}/.local/bin
cp bootstrap.exe $${HOME}/.local/bin/lm-bootstrap
mv bootstrap.exe $${HOME}/.local/bin/lm
endif
smoke-test-clang:
clang $(CFLAGS) BOOTSTRAP/cli.c -o tmp
rm tmp
smoke-test-gcc:
gcc $(CFLAGS) BOOTSTRAP/cli.c -o tmp
rm tmp
smoke-test-musl:
musl-gcc $(CFLAGS) BOOTSTRAP/cli.c -o tmp
rm tmp
smoke-test: smoke-test-clang smoke-test-gcc smoke-test-musl
smoke-test-lite: smoke-test-clang smoke-test-gcc
install:
time $(CC) $(CFLAGS) -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 lib $${HOME}/.lm/