-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
99 lines (73 loc) · 2.47 KB
/
makefile
File metadata and controls
99 lines (73 loc) · 2.47 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
INSTALL_DIR := ~/.local/void
LLVM_LIBS := $(shell llvm-config --libs)
main: stage1
test: test-stage1
clean:
-@rm -rf build
-@rm -rf bootstrap
-@rm -f rt.ll
-@rm -f llvm/llvm_c.vd
clean-but-keep-stage0:
-@find build ! -name 'stage0*' -type f -exec rm -rf {} +
-@rm -rf bootstrap
-@rm -f rt.ll
-@rm -f llvm/llvm_c.vd
stage0: build/stage0
build/stage0: build/stage0.bc
clang build/stage0.bc -o build/stage0 -lc -lm $(LLVM_LIBS) -O3
test-stage0: build/stage0 rt.ll
python3 test.py build/stage0 -- -M -b -s
stage1: build/stage1
build/stage1: build/stage1.ll
clang build/stage1.ll -o build/stage1 -lc -lm $(LLVM_LIBS)
build/stage1.ll: build/stage0 rt.ll std/*.vd src/*.vd src/llvm_c.vd
build/stage0 src/main.vd -o stage1 -c -g -M
test-stage1: build/stage1
python3 test.py build/stage1 -- -M -b -s
stage2: build/stage2
build/stage2: build/stage2.ll
clang build/stage2.ll -o build/stage2 -lc -lm $(LLVM_LIBS)
build/stage2.ll: build/stage1
build/stage1 src/main.vd -o stage2 -c -g -M
test-stage2: build/stage2
python3 test.py build/stage2 -- -M -b -s
src/llvm_c.vd: src/llvm.h
python3 binding_generator.py src/llvm.h src/llvm_c.vd
rt.ll: rt.c
clang rt.c -S -emit-llvm -O3 -o rt.ll
generate-bootstrap-files: build/stage2
build/stage2 src/main.vd -o bootstrap -c -M -O3
build/stage2 src/main.vd -o bootstrap -c -M -O3 -b
build/stage2 src/main.vd -o bootstrap-stripped -c -M -O3 -s
build/stage2 src/main.vd -o bootstrap-stripped -c -M -O3 -s -b
-@mkdir bootstrap -p
-@cp -f build/bootstrap* bootstrap/
update-stage0.bc: build/stage2
build/stage2 src/main.vd -o stage0 -c -M -O3 -b
update-stage0:
-@$(MAKE) --no-print-directory update-stage0.bc
-@$(MAKE) --no-print-directory stage0
download-release-stage0:
wget -O build/stage0.bc https://github.com/ge0mk/void/releases/latest/download/bootstrap.bc
install: stage0 rt.ll std/*.vd
-@mkdir $(INSTALL_DIR)/bin -p
-@cp -f build/stage0 $(INSTALL_DIR)/bin/void
-@cp -f rt.ll $(INSTALL_DIR)/rt.ll
-@cp -rf std $(INSTALL_DIR)/std
samples: stage0 samples/*.vd
build/stage0 samples/json.vd -M
build/stage0 samples/tetris.vd -M -l SDL2
build/stage0 samples/touch.vd -M
.PHONY: \
main test \
clean clean-but-keep-stage0 \
stage0 test-stage0 \
stage1 test-stage1 \
stage2 test-stage2 \
generate-bootstrap-files \
update-stage0.bc update-stage0 \
download-release-stage0 \
install
# llvm libraries:
# llvm-config --libs --link-static core analysis target bitwriter
# llvm also depends on libncurses (terminal io) and libz (compression)