-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (47 loc) · 1.38 KB
/
Makefile
File metadata and controls
62 lines (47 loc) · 1.38 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
%:
@:
.PHONY: all build test check debug run clean help doc
args = `arg="$(filter-out $@,$(MAKECMDGOALS))" && echo $${arg:-${1}}`
CARGO = cargo
all: test build
build:
${CARGO} build --release
cp ../target/release/mithril-client .
run: build
@./mithril-client $(call args,defaultstring)
debug:
@${CARGO} run -- -vvv $(call args,defaultstring)
test:
${CARGO} test
check:
${CARGO} check --release --all-features --all-targets
${CARGO} clippy --release --all-features --all-targets
${CARGO} fmt --check
clean:
${CARGO} clean
help:
@${CARGO} run -- -h
doc:
${CARGO} doc --no-deps --open
docker-build:
cd ../ && docker build -t mithril/mithril-client -f mithril-client-cli/Dockerfile .
docker-build-ci: build
# Check that we are on Linux, then build
if [ "$$(uname -s)" != "Linux" ]; then \
echo "Error: this target only supports Linux"; \
exit 1; \
fi; \
RAW_ARCH=$$(uname -m); \
if [ "$$RAW_ARCH" = "x86_64" ]; then \
ARCH="amd64"; \
elif [ "$$RAW_ARCH" = "aarch64" ]; then \
ARCH="arm64"; \
else \
echo "Error: unsupported architecture $$RAW_ARCH"; \
exit 1; \
fi; \
mkdir -p ./bin-linux-$${ARCH}; \
cp ../target/release/mithril-client ./bin-linux-$${ARCH}/mithril-client
cd ../ && docker build -t mithril/mithril-client -f mithril-client-cli/Dockerfile.ci --build-arg DOCKER_IMAGE_FROM .
docker-run:
docker run --rm --name='mithril-client' mithril/mithril-client