-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (28 loc) · 853 Bytes
/
Copy pathMakefile
File metadata and controls
35 lines (28 loc) · 853 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
35
# wakeup - build and install the binary.
#
# make # build the release binary
# make install # build + copy wakeup to $(PREFIX)/bin
# make uninstall
#
# Override the install location with PREFIX, e.g.:
# make install PREFIX=/usr/local (may need sudo)
# make install PREFIX=/opt/homebrew
PREFIX ?= $(HOME)/.local
BINDIR := $(PREFIX)/bin
BINS := wakeup
.PHONY: all build install uninstall clean
all: build
build:
cargo build --release
install: build
@mkdir -p "$(BINDIR)"
@for b in $(BINS); do \
install -m 0755 "target/release/$$b" "$(BINDIR)/$$b" && \
echo "installed: $(BINDIR)/$$b"; \
done
@case ":$$PATH:" in *":$(BINDIR):"*) ;; \
*) echo "note: add $(BINDIR) to your PATH";; esac
uninstall:
@for b in $(BINS); do rm -f "$(BINDIR)/$$b" && echo "removed: $(BINDIR)/$$b"; done
clean:
cargo clean