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
P_VERSION=$(shell head -n4 Cargo.toml | grep version | cut -d ' ' -f3 | tr -d \")
DEB=target/linux/release/tabin-plugins_$(P_VERSION)_amd64.deb
REBUILD_DEB=0
plugins-deb: $(DEB)
upload:
aws s3 cp $(DEB) s3://knewton-apt/
deb-s3 upload -a amd64 --bucket knewton-public $(DEB) --sign 7E94EA8F
deb: $(DEB)
$(DEB): target/linux/release
cd target/linux/release ; \
mkdir -p usr/local/bin ; \
cp -u check-* usr/local/bin ; \
fpm -s dir -t deb \
-n "tabin-plugins" -v $(P_VERSION) \
--description "Nagios-compatible check scripts" \
usr
echo "deb is in $(CURDIR)/target/linux/release/tabin-plugins_$(P_VERSION)_amd64.deb"
linux: target/linux/release
target/linux/release: src/bin/check-*.rs
docker run -it --rm -e CARGO_TARGET_DIR=target/linux -v $(CURDIR):/source jimmycuadra/rust cargo build --release
rm -f target/linux/release/tabin-plugins_$(P_VERSION)_amd64.deb
target/osx/release: src/bin/check-*.rs
CARGO_TARGET_DIR=target/osx cargo build --release
install: target/osx/release
cp target/osx/release/check-* ~/.local/bin
target/osx/debug: src/bin/check-*.rs
CARGO_TARGET_DIR=target/osx cargo build
install-debug: target/osx/debug
cp target/osx/debug/check-* ~/.local/bin
rebuild:
docker run -it --rm -e CARGO_TARGET_DIR=target/linux -v $(pwd):/source jimmycuadra/rust cargo build --release
rm -f target/linux/release/tabin-plugins_$(P_VERSION)_amd64.deb
.PHONY: rebuild \
linux \
install