[#46] Add buiding of authmate's binaries to makefile

Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
Angira Kekteeva 2021-05-19 12:18:20 +03:00
parent 50e4eb3b43
commit 2847447813

View file

@ -9,10 +9,15 @@ HUB_TAG ?= "$(shell echo ${VERSION} | sed 's/^v//')"
BINDIR = bin BINDIR = bin
BIN = "$(BINDIR)/$(BIN_NAME)" BIN = "$(BINDIR)/$(BIN_NAME)"
AUTHMATE_BIN_NAME=authmate
AUTHMATE_HUB_IMAGE="nspccdev/$(AUTHMATE_BIN_NAME)"
AUTHMATE_HUB_TAG ?= "$(shell echo ${VERSION} | sed 's/^v//')"
AUTHMATE_BIN = "$(BINDIR)/$(AUTHMATE_BIN_NAME)"
.PHONY: help all dep clean format test cover lint docker/lint image-push image dirty-image .PHONY: help all dep clean format test cover lint docker/lint image-push image dirty-image
# Make all binaries # Make all binaries
all: $(BIN) all: $(BIN) $(AUTHMATE_BIN)
$(BIN): $(BINDIR) dep $(BIN): $(BINDIR) dep
@echo "⇒ Build $@" @echo "⇒ Build $@"
@ -21,6 +26,13 @@ $(BIN): $(BINDIR) dep
-ldflags "-X main.Version=$(VERSION)" \ -ldflags "-X main.Version=$(VERSION)" \
-o $@ ./cmd/gate -o $@ ./cmd/gate
$(AUTHMATE_BIN): $(BINDIR) dep
@echo "⇒ Build $@"
CGO_ENABLED=0 \
go build -v -trimpath \
-ldflags "-X main.Version=$(VERSION)" \
-o $@ ./cmd/authmate
$(BINDIR): $(BINDIR):
@echo "⇒ Ensure dir: $@" @echo "⇒ Ensure dir: $@"
@mkdir -p $@ @mkdir -p $@