spotify-adblock/Makefile

37 lines
916 B
Makefile
Raw Normal View History

2021-04-29 14:05:41 -04:00
NAME = spotify-adblock
PREFIX = /usr/local
PROFILE ?= release
BINARY_PATH = target/$(PROFILE)/libspotifyadblock.so
CONFIG_PATH = config.toml
2021-08-23 21:28:41 -04:00
DESKTOP_PATH = spotify-adblock.desktop
2021-04-29 14:05:41 -04:00
BINARY_TARGET = $(DESTDIR)$(PREFIX)/lib/$(NAME).so
CONFIG_TARGET = $(DESTDIR)/etc/$(NAME)/config.toml
2021-08-23 21:28:41 -04:00
DESKTOP_TARGET = $(DESTDIR)$(PREFIX)/share/applications/$(NAME).desktop
2021-04-29 14:05:41 -04:00
.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
2021-08-23 21:28:41 -04:00
install: $(BINARY_PATH) $(CONFIG_PATH) $(DESKTOP_PATH)
install -D --mode=644 --strip $(BINARY_PATH) $(BINARY_TARGET)
install -D --mode=644 $(CONFIG_PATH) $(CONFIG_TARGET)
install -D --mode=644 $(DESKTOP_PATH) $(DESKTOP_TARGET)
2021-04-29 14:05:41 -04:00
.PHONY: uninstall
uninstall:
rm -f $(BINARY_TARGET)
rm -f $(CONFIG_TARGET)
2021-08-23 21:28:41 -04:00
rm -f $(DESKTOP_TARGET)