-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.small
executable file
·106 lines (86 loc) · 3.37 KB
/
Makefile.small
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
.NOTPARALLEL:
.PHONY : build pull clean get_source test
.DEFAULT_GOAL := build
SHELL := /bin/bash
DIRS=lucet-spectre sfi-spectre-testing rlbox_lucet_spectre_sandbox #aligned_clang firefox-stock firefox-spectre
CURR_DIR := $(shell realpath ./)
bootstrap:
sudo apt -y install curl cmake
if [ ! -x "$(shell command -v rustc)" ] ; then \
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y; \
fi
if [ ! -d /opt/wasi-sdk/ ]; then \
wget https://github.com/CraneStation/wasi-sdk/releases/download/wasi-sdk-8/wasi-sdk_8.0_amd64.deb -P /tmp/ && \
sudo dpkg -i /tmp/wasi-sdk_8.0_amd64.deb; \
fi
if [ ! -d /opt/binaryen/ ]; then \
wget https://github.com/WebAssembly/binaryen/releases/download/version_90/binaryen-version_90-x86_64-linux.tar.gz -P /tmp/ && \
sudo mkdir /opt/binaryen && \
sudo tar -xzf /tmp/binaryen-version_90-x86_64-linux.tar.gz -C /opt/binaryen && \
sudo mv /opt/binaryen/binaryen-version_90 /opt/binaryen/bin; \
fi
@echo "--------------------------------------------------------------------------"
@echo "Attention!!!!!!:"
@echo ""
@echo "Installed new packages."
@echo "You need to reload the bash env before proceeding."
@echo ""
@echo "Run the command:"
@echo "source ~/.profile"
@echo "and run 'make' to build the source"
@echo ""
@echo "--------------------------------------------------------------------------"
touch ./bootstrap
lucet-spectre:
git clone [email protected]:PLSysSec/lucet-spectre.git $@
cd $@ && git submodule update --init --recursive
sfi-spectre-testing:
git clone [email protected]:PLSysSec/sfi-spectre-testing.git $@
cd $@ && git submodule update --init --recursive
rlbox_lucet_spectre_sandbox:
git clone [email protected]:PLSysSec/rlbox_lucet_spectre_sandbox.git $@
cd $@ && git checkout experimental
cd $@ && git submodule update --init --recursive
CUSTOM_LUCET_DIR=$(CURR_DIR)/lucet-spectre cmake -S $@ -B $@/build
aligned_clang:
git clone https://github.com/llvm/llvm-project.git $@
cd $@ && git checkout -b 14fc20ca6282
firefox-stock:
git clone https://github.com/PLSysSec/firefox-spectre $@
cd $@ && git checkout stock
firefox-spectre:
git clone https://github.com/PLSysSec/firefox-spectre $@
get_source: $(DIRS)
install_deps: $(DIRS)
#$(MAKE) -C ./firefox-stock bootstrap
# don't need to run bootstrap in second firefox repo
#touch ./firefox-spectre/builds/bootstrap
#touch ./install_deps
pull: get_source
git pull
cd rlbox_lucet_spectre_sandbox && git pull --recurse-submodules
cd lucet-spectre && git pull --recurse-submodules
cd sfi-spectre-testing && git pull --recurse-submodules
#cd firefox-stock && git pull
#cd firefox-spectre && git pull
spec:
git clone [email protected]:PLSysSec/sfi-spectre-spec.git
out/aligned_clang/bin/clang:
mkdir -p out/aligned_clang
cd out/aligned_clang && cmake -DLLVM_ENABLE_PROJECTS=clang $(CURR_DIR)/aligned_clang/llvm
# Some build failures exist which seem ignorable
-$(MAKE) -C out/aligned_clang
build: install_deps
cd lucet-spectre && cargo build
$(MAKE) -C rlbox_lucet_spectre_sandbox/build
$(MAKE) -C sfi-spectre-testing build
test:
$(MAKE) -C rlbox_lucet_spectre_sandbox/build check
$(MAKE) -C sfi-spectre-testing test
$(MAKE) -C lucet-spectre/benchmarks/shootout
clean:
-cd lucet-spectre && cargo clean
-$(MAKE) -C sfi-spectre-testing clean
-$(MAKE) -C out/aligned_clang clean
-$(MAKE) -C firefox-stock/builds clean
-$(MAKE) -C firefox-spectre/builds clean