forked from linead/docker-socket-firewall
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (44 loc) · 1.25 KB
/
Makefile
File metadata and controls
57 lines (44 loc) · 1.25 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
.DEFAULT_GOAL := ci
BIN ?= docker-socket-firewall
PKG := github.com/linead/docker-socket-firewall
local : ARCH ?= $(shell go env GOOS)-$(shell go env GOARCH)
ARCH ?= linux-amd64
SRC_DIRS := cmd pkg # directories which hold app source (not vendored)
CLI_PLATFORMS := linux-amd64 darwin-amd64
platform_temp = $(subst -, ,$(ARCH))
GOOS = $(word 1, $(platform_temp))
GOARCH = $(word 2, $(platform_temp))
VERSION ?= master
local: build-dirs
GOOS=$(GOOS) \
GOARCH=$(GOARCH) \
VERSION=$(VERSION) \
PKG=$(PKG) \
BIN=$(BIN) \
OUTPUT_DIR=$$(pwd)/_output/bin/$(GOOS)/$(GOARCH) \
./hack/build.sh
mac:
GOOS=darwin \
GOARCH=amd64 \
VERSION=$(VERSION) \
PKG=$(PKG) \
BIN=$(BIN) \
OUTPUT_DIR=$$(pwd)/_output/bin/linux/amd64 \
./hack/build.sh
linux:
GOOS=linux \
GOARCH=amd64 \
VERSION=$(VERSION) \
PKG=$(PKG) \
BIN=$(BIN) \
OUTPUT_DIR=$$(pwd)/_output/bin/linux/amd64 \
./hack/build.sh
tests:
go test -covermode=count ./...
ci: build-ci-dirs tests mac linux
build-ci-dirs:
@mkdir -p _output/bin/linux/amd64 _output/bin/darwin/amd64
@mkdir -p .go/src/$(PKG) .go/pkg .go/bin .go/std/linux/amd64 .go/std/darwin/amd64 .go/go-build
build-dirs:
@mkdir -p _output/bin/$(GOOS)/$(GOARCH)
@mkdir -p .go/src/$(PKG) .go/pkg .go/bin .go/std/$(GOOS)/$(GOARCH) .go/go-build