CARGO_TARGET_DIR ?= $(shell pwd)/../target
CARGO_TARGET_DIR := $(abspath $(CARGO_TARGET_DIR))
SOP ?= $(CARGO_TARGET_DIR)/debug/sqop
CARGO ?= cargo
ifneq ($(filter Darwin %BSD,$(shell uname -s)),)
INSTALL ?= ginstall
else
INSTALL ?= install
endif
.PHONY: build-release
build-release:
CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \
$(CARGO) build $(CARGO_FLAGS) --release --package sequoia-sop
.PHONY: install
install: build-release
$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -t $(DESTDIR)$(PREFIX)/bin $(CARGO_TARGET_DIR)/release/sqop