vaultwarden/Makefile
Robert Kaussow 88d47949e5
Some checks reported errors
continuous-integration/drone/push Build was killed
switch back to v1.14.2 for now
2020-06-04 14:57:22 +02:00

29 lines
717 B
Makefile

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