From 28474478133a9aff56190f5a10d689b588f3593d Mon Sep 17 00:00:00 2001 From: Angira Kekteeva Date: Wed, 19 May 2021 12:18:20 +0300 Subject: [PATCH] [#46] Add buiding of authmate's binaries to makefile Signed-off-by: Angira Kekteeva --- Makefile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5310c17..064fb54 100644 --- a/Makefile +++ b/Makefile @@ -9,10 +9,15 @@ HUB_TAG ?= "$(shell echo ${VERSION} | sed 's/^v//')" BINDIR = bin 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 # Make all binaries -all: $(BIN) +all: $(BIN) $(AUTHMATE_BIN) $(BIN): $(BINDIR) dep @echo "⇒ Build $@" @@ -21,6 +26,13 @@ $(BIN): $(BINDIR) dep -ldflags "-X main.Version=$(VERSION)" \ -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): @echo "⇒ Ensure dir: $@" @mkdir -p $@