-
Notifications
You must be signed in to change notification settings - Fork 39
/
Makefile
66 lines (55 loc) · 1.51 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
default: build
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
github_user := "equinix"
project := "github.com/$(github_user)/$(current_dir)"
bin_suffix := ""
containerbuild:
docker build -t $(current_dir) .
docker run \
-v $(shell pwd):/go/src/$(project) \
-e GOOS \
-e GOARCH \
-e GO15VENDOREXPERIMENT=1 \
$(current_dir) \
make build
clean:
rm -r docker-machine-driver-metal bin/docker-machine-driver-metal
compile:
GO111MODULE=on GOGC=off CGOENABLED=0 go build -ldflags "-s"
# deprecated in favor of goreleaser
pack: cross
find ./bin -mindepth 1 -type d -exec zip -r -j {}.zip {} \;
# deprecated in favor of goreleaser
checksums: pack
for file in $(shell find bin -type f -name '*.zip'); do \
( \
cd $$(dirname $$file); \
f=$$(basename $$file); \
b2sum --tag $$f && \
sha256sum --tag $$f && \
sha512sum --tag $$f ; \
) \
done | sort >$@.tmp
@mv $@.tmp $@
print-success:
@echo
@echo "Plugin built."
@echo
@echo "To use it, either run 'make install' or set your PATH environment variable correctly."
build: compile print-success
# deprecated in favor of goreleaser
cross:
for os in darwin windows linux; do \
for arch in amd64; do \
GOOS=$$os GOARCH=$$arch BIN_SUFFIX=_$$os-$$arch $(MAKE) compile & \
done; \
done; \
wait
install:
cp bin/$(current_dir)/$(current_dir) /usr/local/bin/$(current_dir)
tag:
if ! git tag | grep -q $(version); then \
git tag -m $(version) $(version); \
git push --tags; \
fi