-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (35 loc) · 1.18 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
# The directory to move files into as part of the installation procedure.
DESTDIR :=
# The base directory for files at runtime.
PREFIX := /usr
ifneq (${DESTDIR},)
INSTALL_PREFIX = ${DESTDIR}${PREFIX}
else
INSTALL_PREFIX = ${PREFIX}
endif
INSTALL_BIN := ${INSTALL_PREFIX}/bin/ivm
INSTALL_LICENSE := ${INSTALL_PREFIX}/share/licenses/ivm/LICENSE
# The version of ivm, obtained from Cargo.toml.
VERSION != cargo pkgid | cut -d\# -f2 | cut -d: -f2
build:
cargo build --release
install: ${INSTALL_BIN} ${INSTALL_LICENSE}
${INSTALL_BIN}:
mkdir -p "$$(dirname ${@})"
install -m755 target/release/ivm "${@}"
${INSTALL_LICENSE}:
mkdir -p "$$(dirname ${@})"
install -m644 LICENSE "${@}"
release/versions:
ruby scripts/update_versions.rb ${VERSION}
release/changelog:
clogs "${VERSION}"
release/commit:
git commit Cargo.toml Cargo.lock CHANGELOG.md -m "Release v${VERSION}"
git push origin "$$(git rev-parse --abbrev-ref HEAD)"
release/tag:
git tag -a -m "Release v${VERSION}" "v${VERSION}"
git push origin "v${VERSION}"
release/publish: release/versions release/changelog release/commit release/tag
cargo publish
.PHONY: build release/changelog release/commit release/tag release/publish