-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (26 loc) · 963 Bytes
/
Copy pathMakefile
File metadata and controls
34 lines (26 loc) · 963 Bytes
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
PREFIX := /usr/local
PKGNAME := movie-rename
build:
cargo build --release --target x86_64-unknown-linux-musl
build-debug:
cargo build
clean:
cargo clean
install: build
install -Dm755 target/release/$(PKGNAME) "$(DESTDIR)$(PREFIX)/bin/$(PKGNAME)"
install -Dm644 $(PKGNAME).1 "$(DESTDIR)$(PREFIX)/man/man1/$(PKGNAME).1"
uninstall:
rm -f "$(DESTDIR)$(PREFIX)/bin/$(PKGNAME)"
rm -f "$(DESTDIR)$(PREFIX)/man/man1/$(PKGNAME).1"
conf_tag := $(shell cat Cargo.toml | sed -rn 's/^version = "(.+)"$$/\1/p')
last_tag := $(shell git tag -l | tail -1)
bumped := $(shell git log -1 --pretty=%B | grep "build: Bumped version to " | wc -l)
tag:
ifneq (${conf_tag}, ${last_tag})
ifeq (${bumped}, 1)
git tag ${conf_tag} -m "Version ${conf_tag}"
endif
endif
aur: build
tar --transform 's/.*\///g' -czf $(PKGNAME).tar.gz target/x86_64-unknown-linux-musl/release/$(PKGNAME) target/autocomplete/* $(PKGNAME).1
.PHONY: build build-debug install clean uninstall aur tag