PACKAGE= pandora
VERSION= 0.6.2
PROFILE?= release
PREFIX= $(HOME)/.local
BIN_DIR = $(PREFIX)/bin
CARGO?= cargo
INSTALL?= install
CARGOFLAGS?= -j$(shell nproc)
SRC=\
pandora.rs \
Cargo.toml
ifeq ($(PROFILE), debug)
BIN= ./target/debug/$(PACKAGE)
else
BIN= ./target/release/$(PACKAGE)
CARGOFLAGS+= --release
endif
all: $(BIN)
fmt:
$(CARGO) fmt
lint:
$(CARGO) deny check
$(CARGO) acl -n || true
$(CARGO) clippy $(CARGOFLAGS)
install: $(BIN)
$(INSTALL) -d $(BIN_DIR)
$(INSTALL) -m 755 $(BIN) $(BIN_DIR)
uninstall:
rm -f $(BIN_DIR)/$(PACKAGE)
check: test
test: $(BIN)
$(CARGO) test $(CARGOFLAGS)
clean:
$(CARGO) clean
$(BIN): $(SRC)
$(CARGO) build $(CARGOFLAGS)
.PHONY: all clean check test install uninstall fmt lint