forked from cni-genie/CNI-Genie
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
34 lines (25 loc) · 865 Bytes
/
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
# Disable make's implicit rules, which are not useful for golang, and slow down the build
# considerably.
.SUFFIXES:
GO_PATH=$(GOPATH)
SRCFILES=cni-genie.go
TEST_SRCFILES=$(wildcard *_test.go)
# Ensure that the dist directory is always created
MAKE_SURE_DIST_EXIST := $(shell mkdir -p dist)
.PHONY: all plugin
default: clean all
all: plugin
plugin: dist/genie
.PHONY: test
test: dist/genie-test
.PHONY: clean
clean:
rm -rf dist
release: clean
# Build the genie cni plugin
dist/genie: $(SRCFILES)
@GOPATH=$(GO_PATH) CGO_ENABLED=0 go build -v -i -o dist/genie \
-ldflags "-X main.VERSION=1.0 -s -w" cni-genie.go
# Build the genie cni plugin tests
dist/genie-test: $(TEST_SRCFILES)
@GOPATH=$(GO_PATH) CGO_ENABLED=0 ETCD_IP=127.0.0.1 PLUGIN=genie CNI_SPEC_VERSION=0.3.0 go test -args --testKubeVersion=$(testKubeVersion) --testKubeConfig=$(testKubeConfig)