forked from moby/buildkit
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
103 lines (79 loc) · 1.95 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
prefix=/usr/local
bindir=$(prefix)/bin
version?=$(shell hack/version.sh)
export BUILDX_CMD ?= docker buildx
.PHONY: binaries
binaries:
$(BUILDX_CMD) bake binaries
.PHONY: cross
cross:
$(BUILDX_CMD) bake binaries-cross
.PHONY: images
images:
# moby/buildkit:local and moby/buildkit:local-rootless are created on Docker
hack/images local moby/buildkit
TARGET=rootless hack/images local moby/buildkit
.PHONY: install
install:
mkdir -p $(DESTDIR)$(bindir)
install bin/build/* $(DESTDIR)$(bindir)
.PHONY: release
release:
./hack/release
.PHONY: clean
clean:
rm -rf ./bin
.PHONY: test
test:
./hack/test integration gateway dockerfile
.PHONY: test-race
test-race:
CGO_ENABLED=1 GOBUILDFLAGS="-race" ./hack/test integration gateway dockerfile
.PHONY: lint
lint:
$(BUILDX_CMD) bake lint
.PHONY: validate-vendor
validate-vendor:
$(BUILDX_CMD) bake validate-vendor
.PHONY: validate-shfmt
validate-shfmt:
$(BUILDX_CMD) bake validate-shfmt
.PHONY: shfmt
shfmt:
$(BUILDX_CMD) bake shfmt
.PHONY: validate-authors
validate-authors:
$(BUILDX_CMD) bake validate-authors
.PHONY: validate-generated-files
validate-generated-files:
$(BUILDX_CMD) bake validate-generated-files
.PHONY: validate-doctoc
validate-doctoc:
$(BUILDX_CMD) bake validate-doctoc
.PHONY: validate-docs
validate-docs:
$(BUILDX_CMD) bake validate-docs
.PHONY: validate-all
validate-all: test lint validate-vendor validate-generated-files validate-doctoc validate-docs
.PHONY: vendor
vendor:
$(eval $@_TMP_OUT := $(shell mktemp -d -t buildkit-output.XXXXXXXXXX))
$(BUILDX_CMD) bake --set "*.output=type=local,dest=$($@_TMP_OUT)" vendor
rm -rf ./vendor
cp -R "$($@_TMP_OUT)"/out/* .
rm -rf "$($@_TMP_OUT)"/
.PHONY: generated-files
generated-files:
$(BUILDX_CMD) bake generated-files
.PHONY: authors
authors:
$(BUILDX_CMD) bake authors
.PHONY: doctoc
doctoc:
$(BUILDX_CMD) bake doctoc
.PHONY: docs
docs:
$(BUILDX_CMD) bake docs
.PHONY: mod-outdated
mod-outdated:
$(BUILDX_CMD) bake mod-outdated