Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@ ATECTL := $(BINDIR)/kubectl-ate
# Version stamping. Override on the make command line to pin
# (e.g. `make VERSION=v0.5.0 build`).
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
COMMIT ?= $(shell git rev-parse HEAD 2>/dev/null || echo unknown)
BUILD_DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
VERSION_PKG := github.com/agent-substrate/substrate/internal/version
LDFLAGS := -X $(VERSION_PKG).Version=$(VERSION) \
-X $(VERSION_PKG).Commit=$(COMMIT) \
-X $(VERSION_PKG).BuildDate=$(BUILD_DATE)
LDFLAGS := -X=$(VERSION_PKG).Version=$(VERSION)

.PHONY: all
all: build
Expand All @@ -44,10 +40,12 @@ build: build-images build-atectl

.PHONY: build-images
build-images:
$(KO) build --ldflags "$(LDFLAGS)" ./cmd/ateapi
$(KO) build --ldflags "$(LDFLAGS)" ./cmd/atelet
$(KO) build --ldflags "$(LDFLAGS)" ./cmd/podcertcontroller
$(KO) build --ldflags "$(LDFLAGS)" ./cmd/atenet
GOFLAGS='"-ldflags=$(LDFLAGS)"' \
$(KO) build \
./cmd/ateapi \
./cmd/atelet \
./cmd/podcertcontroller \
./cmd/atenet

.PHONY: build-atectl
build-atectl:
Expand All @@ -59,7 +57,8 @@ build-atenet:

.PHONY: build-demos
build-demos:
$(KO) build --ldflags "$(LDFLAGS)" ./demos/counter
GOFLAGS='"-ldflags=$(LDFLAGS)"' \
$(KO) build ./demos/counter

.PHONY: test
test:
Expand Down
Loading