forked from oras-project/oras
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (35 loc) · 1.03 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
CLI_EXE = oras
CLI_PKG = github.com/deislabs/oras/cmd/oras
DEP = $(GOPATH)/bin/dep
.PHONY: test
test: vendor
./scripts/test.sh
.PHONY: covhtml
covhtml:
open .cover/coverage.html
.PHONY: clean
clean:
git status --ignored --short | grep '^!! ' | sed 's/!! //' | xargs rm -rf
.PHONY: build
build: build-linux build-mac build-windows vendor
.PHONY: build-linux
build-linux: vendor
GOARCH=amd64 CGO_ENABLED=0 GOOS=linux go build -v --ldflags="-w" \
-o bin/linux/amd64/$(CLI_EXE) $(CLI_PKG)
.PHONY: build-mac
build-mac: vendor
GOARCH=amd64 CGO_ENABLED=0 GOOS=darwin go build -v --ldflags="-w" \
-o bin/darwin/amd64/$(CLI_EXE) $(CLI_PKG)
.PHONY: build-windows
build-windows: vendor
GOARCH=amd64 CGO_ENABLED=0 GOOS=windows go build -v --ldflags="-w" \
-o bin/windows/amd64/$(CLI_EXE).exe $(CLI_PKG)
$(DEP):
go get -u github.com/golang/dep/cmd/dep
# install vendored dependencies
vendor: Gopkg.lock
$(DEP) ensure -v --vendor-only
# update vendored dependencies
Gopkg.lock: Gopkg.toml
$(DEP) ensure -v --no-vendor
Gopkg.toml: $(DEP)