-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (26 loc) · 1.12 KB
/
Copy pathMakefile
File metadata and controls
35 lines (26 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
BINARY := kumabox
BIN_DIR := bin
GUEST_AGENT_BINARY_AMD64 := oci-images/ubuntu/kumabox-agent-linux-amd64
GUEST_AGENT_BINARY_ARM64 := oci-images/ubuntu/kumabox-agent-linux-arm64
VERSION ?= 0.0.0-dev
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
BUILD_TIME ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS := -X github.com/kumabox/kumabox/internal/version.Version=$(VERSION) \
-X github.com/kumabox/kumabox/internal/version.Commit=$(COMMIT) \
-X github.com/kumabox/kumabox/internal/version.BuildTime=$(BUILD_TIME)
.PHONY: build build-agent build-agent-linux-amd64 build-agent-linux-arm64 test test-e2e clean
build: build-agent
mkdir -p $(BIN_DIR)
go build -ldflags "$(LDFLAGS)" -o $(BIN_DIR)/$(BINARY) ./cmd/kumabox
build-agent:
$(MAKE) build-agent-linux-amd64 build-agent-linux-arm64
build-agent-linux-amd64:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o $(GUEST_AGENT_BINARY_AMD64) ./cmd/agent
build-agent-linux-arm64:
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o $(GUEST_AGENT_BINARY_ARM64) ./cmd/agent
test:
go test ./...
test-e2e:
test/e2e/e2e.sh $(E2E_ARGS)
clean:
rm -rf $(BIN_DIR)