-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile
60 lines (41 loc) · 1.38 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
ifeq ($(PREFIX),)
PREFIX := /usr/local
endif
SOURCEDIRS:=src src/tools src/ui
SOURCEFILES:=$(foreach d,$(SOURCEDIRS),$(wildcard $(d)/*.rs))
build: target/debug/satty
build-release: target/release/satty
force-build:
cargo build
force-build-release:
cargo build --release
target/debug/satty: $(SOURCEFILES)
cargo build
target/release/satty: $(SOURCEFILES)
cargo build --release
clean:
cargo clean
install: target/release/satty
install -s -Dm755 target/release/satty -t ${PREFIX}/bin/
install -Dm644 satty.desktop ${PREFIX}/share/applications/satty.desktop
install -Dm644 assets/satty.svg ${PREFIX}/share/icons/hicolor/scalable/apps/satty.svg
install -Dm644 LICENSE ${PREFIX}/share/licenses/satty/LICENSE
uninstall:
rm ${PREFIX}/bin/satty
rmdir -p ${PREFIX}/bin || true
rm ${PREFIX}/share/applications/satty.desktop
rmdir -p ${PREFIX}/share/applications || true
rm ${PREFIX}/share/icons/hicolor/scalable/apps/satty.svg
rmdir -p ${PREFIX}/share/icons/hicolor/scalable/apps || true
rm ${PREFIX}/share/licenses/satty/LICENSE
rmdir -p ${PREFIX}/share/licenses/satty || true
package: clean build-release
$(eval TMP := $(shell mktemp -d))
echo "Temporary folder ${TMP}"
# install to tmp
PREFIX=${TMP} make install
# create package
$(eval LATEST_TAG := $(shell git describe --tags --abbrev=0))
tar -czvf satty-${LATEST_TAG}-x86_64.tar.gz -C ${TMP} .
# clean up
rm -rf $(TMP)