forked from kube-arbiter/arbiter-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (47 loc) · 1.22 KB
/
Makefile
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
GOOS ?= linux
GOARCH ?= $(shell go env GOARCH)
GOFLAGS ?=""
SOURCES := $(shell find . -type f -name '*.go')
REGISTRY ?= "docker.io/kubearbiter"
DOCKER_TARGETS := observer-default-plugins \
executor-default-plugins
TARGETS := ${DOCKER_TARGETS} \
WHAT ?= $(TARGETS)
# Build binary
#
# Args:
# WHAT: Target to build.
# GOOS: OS to build.
# GOARCH: Arch to build.
#
# Example:
# make all
# make all WHAT=observer-metric-server
# make all WHAT=observer-metric-server GOOS=linux GOARCH=amd64
.PHONY: all
all: binary
binary:
@GOFLAGS=$(GOFLAGS) BUILD_PLATFORMS=$(GOOS)/$(GOARCH) hack/build.sh $(WHAT)
.PHONY: clean
clean:
rm -rf _output
.PHONY: update
.PHONY: verify
verify:
@hack/verify-all.sh
# Build image.
#
# Args:
# WHAT: Target to build.
# GOOS: OS to build.
# GOARCH: Arch to build.
# OUTPUT_TYPE: Destination to save image(docker/registry).
#
# Example:
# make images
# make image WHAT=observer
# make image WHAT=observer GOARCH=arm64
# make image WHAT=observer GOARCH=amd64 OUTPUT_TYPE=registry
.PHONY: images
image:
@REGISTRY=$(REGISTRY) OUTPUT_TYPE=$(OUTPUT_TYPE) BUILD_PLATFORMS=$(GOOS)/$(GOARCH) hack/build-image.sh $(filter ${DOCKER_TARGETS}, ${WHAT})