-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
79 lines (59 loc) · 2.02 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
77
78
79
DESTDIR = /usr
SRCDIR = target/release
INSTALL_PATH = $(DESTDIR)/bin
EXECUTABLE = barnowld
SRC_SERVICEDIR = config
DST_SERVICEDIR = /etc/systemd/system
SERVICEFILE = barnowld.service
all: build docker
build:
cargo build
musl:
cargo build --target=x86_64-unknown-linux-musl
strip target/x86_64-unknown-linux-musl/debug/barnowld -o container/barnowld
docker: musl
docker build -t barnowld container
release:
cargo build --release
clippy:
cargo clippy
clean:
cargo clean
run:
cargo run
test: build
cargo test
format:
rustfmt src/*
format-check:
cargo fmt --all -- --check
get-pocs:
@mkdir poc
git clone https://github.com/crozone/SpectrePoC.git poc/spectre-poc
git clone https://github.com/paboldin/meltdown-exploit.git meldown-poc
git clone https://github.com/sslab-gatech/DrK.git drk-poc
git clone https://github.com/DanGe42/flush-reload.git flush-reload-poc
git clone https://github.com/Miro-H/CacheSC.git cache-sc-poc
git clone https://github.com/PittECEArch/AdversarialPrefetch.git adversarial-prefetch-poc
git clone https://github.com/Anton-Cao/spectrev2-poc.git spectrev2-poc
install: release
@echo Install barnowld executable to $(INSTALL_PATH)
sudo install -D -m 755 $(SRCDIR)/$(EXECUTABLE) $(INSTALL_PATH)/$(EXECUTABLE)
@echo Install systemd service file to $(DST_SERVICEDIR)
sudo install -D -m 644 $(SRC_SERVICEDIR)/$(SERVICEFILE) $(DST_SERVICEDIR)/$(SERVICEFILE)
$(MAKE) help-service
uninstall:
rm -rf $(INSTALL_PATH)/$(EXECUTABLE)
rm -rf $(DST_SERVICEDIR)/$(SERVICEFILE)
help-service:
@echo
@echo The installation routine did *not* activate the service.
@echo Short reminder how to deal with newly installed service files - helpful systemd commands
@echo
@echo sudo systemctl daemon-reload
@echo sudo systemctl enable $(SERVICEFILE)
@echo sudo systemctl start $(SERVICEFILE)
@echo sudo systemctl status $(SERVICEFILE)
@echo sudo systemctl stop $(SERVICEFILE)
@echo sudo journalctl -u $(SERVICEFILE) -f
.PHONY: build install uninstall help-service get-pocs format-check format test clean clippy musl