2020-06-03 22:35:30 +00:00
|
|
|
export BUILD_VERSION ?= 1.14.2
|
2020-02-22 16:04:30 +00:00
|
|
|
export DEBIAN_FRONTEND ?= noninteractive
|
|
|
|
export LANG ?= C.UTF-8
|
|
|
|
export TZ ?= UTC
|
2020-06-03 21:58:55 +00:00
|
|
|
export RUSTFLAGS ?= -C link-arg=-s
|
2020-02-22 15:58:35 +00:00
|
|
|
DB ?= postgresql
|
|
|
|
SRC := src
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: build
|
|
|
|
|
|
|
|
.PHONY: build
|
|
|
|
build: build-src build-bin
|
|
|
|
|
|
|
|
.PHONY: build-src
|
|
|
|
build-src:
|
|
|
|
mkdir -p $(SRC); \
|
2020-02-22 16:04:30 +00:00
|
|
|
curl -sSL "https://github.com/dani-garcia/bitwarden_rs/archive/$${BUILD_VERSION##v}.tar.gz" | tar xz -C $(SRC) --strip-components=1
|
2020-02-22 15:58:35 +00:00
|
|
|
|
|
|
|
.PHONY: build-bin
|
|
|
|
build-bin:
|
|
|
|
rustup set profile minimal && \
|
|
|
|
cd $(SRC) && \
|
2020-03-22 14:39:16 +00:00
|
|
|
rustup target add x86_64-unknown-linux-musl && \
|
2020-04-12 16:48:12 +00:00
|
|
|
BWRS_VERSION="$${BUILD_VERSION##v}" cargo build -j 8 --features $(DB) --release
|
2020-02-22 15:58:35 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -rf $(SRC)
|