diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-06-18 14:52:35 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-06-18 15:58:36 +0200 |
commit | c99514eba879b318c25e0736064a5412ecc8fd28 (patch) | |
tree | 22a63aa0b82548249bfa0124debb9da6e10ed69f /store | |
parent | 022521a0f24143eb124ba4e1ec2f98bea04d170c (diff) |
Improve install target.
- Add explicit build-release and install targets.
- Explicitly build the crates.
- Move installation to the crate's Makefile.
- This allows building of Sequoia's individual parts, e.g. by using
'make -Copenpgp-ffi install'.
Diffstat (limited to 'store')
-rw-r--r-- | store/Makefile | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/store/Makefile b/store/Makefile new file mode 100644 index 00000000..2b907289 --- /dev/null +++ b/store/Makefile @@ -0,0 +1,24 @@ +# Configuration. +CARGO_TARGET_DIR ?= $(shell pwd)/../target +# We currently only support absolute paths. +CARGO_TARGET_DIR := $(abspath $(CARGO_TARGET_DIR)) + +# Tools. +CARGO ?= cargo +ifeq ($(shell uname -s), Darwin) + INSTALL ?= ginstall +else + INSTALL ?= install +endif + +# Installation. +.PHONY: build-release +build-release: + CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \ + $(CARGO) build $(CARGO_FLAGS) --release --package sequoia-store + +.PHONY: install +install: build-release + $(INSTALL) -d $(DESTDIR)$(PREFIX)/lib/sequoia + $(INSTALL) -t $(DESTDIR)$(PREFIX)/lib/sequoia \ + $(CARGO_TARGET_DIR)/release/sequoia-public-key-store |