-
Notifications
You must be signed in to change notification settings - Fork 110
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (27 loc) · 709 Bytes
/
Makefile
File metadata and controls
32 lines (27 loc) · 709 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
NAME = spotify-adblock
PREFIX = /usr/local
PROFILE ?= release
BINARY_PATH = target/$(PROFILE)/libspotifyadblock.so
CONFIG_PATH = config.toml
BINARY_TARGET = $(DESTDIR)$(PREFIX)/lib/$(NAME).so
CONFIG_TARGET = $(DESTDIR)/etc/$(NAME)/config.toml
.PHONY: all
all: $(BINARY_PATH)
$(BINARY_PATH): src Cargo.toml
# cargo build --profile $(PROFILE)
ifeq ($(PROFILE), release)
cargo build --release
else
cargo build
endif
.PHONY: clean
clean:
rm -rf target
.PHONY: install
install: $(BINARY_PATH) $(CONFIG_PATH)
install -D --mode=644 --strip $(BINARY_PATH) $(BINARY_TARGET)
install -D --mode=644 $(CONFIG_PATH) $(CONFIG_TARGET)
.PHONY: uninstall
uninstall:
rm -f $(BINARY_TARGET)
rm -f $(CONFIG_TARGET)