diff --git a/Makefile b/Makefile index 1c8b8631f..aaad91c48 100644 --- a/Makefile +++ b/Makefile @@ -5,36 +5,25 @@ REPO ?= $(shell go list -m) VERSION ?= "$(shell git describe --tags 2>/dev/null || git rev-parse --short HEAD | sed 's/^v//')" BINDIR = bin -# s3 gw variables -BIN_NAME=neofs-s3-gw -BIN = "$(BINDIR)/$(BIN_NAME)" +# Binaries to build +CMDS = $(addprefix neofs-, $(notdir $(wildcard cmd/*))) +BINS = $(addprefix $(BINDIR)/, $(CMDS)) # Variables for docker HUB_IMAGE ?= "nspccdev/$(BIN_NAME)" HUB_TAG ?= "$(shell echo ${VERSION} | sed 's/^v//')" -# Authmate variables -AUTHMATE_BIN_NAME=neofs-authmate -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) $(AUTHMATE_BIN) +all: $(BINS) -$(BIN): $(BINDIR) dep +$(BINS): $(BINDIR) dep @echo "⇒ Build $@" CGO_ENABLED=0 \ go build -v -trimpath \ -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 + -o $@ ./cmd/$(subst neofs-,,$(notdir $@)) $(BINDIR): @echo "⇒ Ensure dir: $@" diff --git a/cmd/gate/app-healthy.go b/cmd/s3-gw/app-healthy.go similarity index 100% rename from cmd/gate/app-healthy.go rename to cmd/s3-gw/app-healthy.go diff --git a/cmd/gate/app-metrics.go b/cmd/s3-gw/app-metrics.go similarity index 100% rename from cmd/gate/app-metrics.go rename to cmd/s3-gw/app-metrics.go diff --git a/cmd/gate/app-profiler.go b/cmd/s3-gw/app-profiler.go similarity index 100% rename from cmd/gate/app-profiler.go rename to cmd/s3-gw/app-profiler.go diff --git a/cmd/gate/app-settings.go b/cmd/s3-gw/app-settings.go similarity index 100% rename from cmd/gate/app-settings.go rename to cmd/s3-gw/app-settings.go diff --git a/cmd/gate/app.go b/cmd/s3-gw/app.go similarity index 100% rename from cmd/gate/app.go rename to cmd/s3-gw/app.go diff --git a/cmd/gate/app_router.go b/cmd/s3-gw/app_router.go similarity index 100% rename from cmd/gate/app_router.go rename to cmd/s3-gw/app_router.go diff --git a/cmd/gate/main.go b/cmd/s3-gw/main.go similarity index 100% rename from cmd/gate/main.go rename to cmd/s3-gw/main.go