2017-04-25 12:57:06 -04:00
#
2017-05-09 12:38:23 -04:00
# github.com/docker/cli
2017-04-25 12:57:06 -04:00
#
2017-05-14 13:24:10 -04:00
all : binary
2017-07-19 11:44:39 -04:00
2017-06-23 00:52:34 -04:00
_ := $( shell ./scripts/warn-outside-container $( MAKECMDGOALS) )
2017-05-09 17:29:14 -04:00
.PHONY : clean
2017-07-19 11:44:39 -04:00
clean : ## remove build artifacts
2017-05-10 21:24:32 -04:00
rm -rf ./build/* cli/winresources/rsrc_* ./man/man[ 1-9] docs/yaml/gen
2017-04-25 12:57:06 -04:00
2017-08-14 15:47:06 -04:00
.PHONY : test -unit
2019-01-28 04:27:35 -05:00
test-unit : ## run unit tests, to change the output format use: GOTESTSUM_FORMAT=(dots|short|standard-quiet|short-verbose|standard-verbose) make test-unit
2019-03-11 12:02:55 -04:00
gotestsum $( TESTFLAGS) -- $$ { TESTDIRS:-$( shell go list ./... | grep -vE '/vendor/|/e2e/' ) }
2017-04-27 18:57:35 -04:00
2017-08-30 18:06:22 -04:00
.PHONY : test
test : test -unit ## run tests
2017-05-18 04:48:24 -04:00
.PHONY : test -coverage
2017-07-19 11:44:39 -04:00
test-coverage : ## run test coverage
2019-01-28 04:27:35 -05:00
gotestsum -- -coverprofile= coverage.txt $( shell go list ./... | grep -vE '/vendor/|/e2e/' )
2017-05-18 04:48:24 -04:00
2018-12-10 08:17:14 -05:00
.PHONY : fmt
fmt :
go list -f { { .Dir} } ./... | xargs gofmt -w -s -d
2017-05-11 18:52:17 -04:00
.PHONY : binary
2021-03-05 17:13:46 -05:00
binary :
docker buildx bake binary
2017-05-11 18:52:17 -04:00
2018-12-10 10:30:19 -05:00
.PHONY : plugins
plugins : ## build example CLI plugins
./scripts/build/plugins
2017-05-09 17:29:14 -04:00
.PHONY : cross
2021-03-05 17:13:46 -05:00
cross :
docker buildx bake cross
2017-09-13 18:51:30 -04:00
2018-12-10 10:30:19 -05:00
.PHONY : plugins -windows
plugins-windows : ## build example CLI plugins for Windows
./scripts/build/plugins-windows
.PHONY : plugins -osx
plugins-osx : ## build example CLI plugins for macOS
./scripts/build/plugins-osx
2017-05-11 18:52:17 -04:00
.PHONY : dynbinary
2017-07-19 11:44:39 -04:00
dynbinary : ## build dynamically linked binary
2021-03-05 17:13:46 -05:00
USE_GLIBC = 1 docker buildx bake dynbinary
2017-05-11 18:52:17 -04:00
2017-07-19 11:44:39 -04:00
vendor : vendor .conf ## check that vendor matches vendor.conf
2018-02-02 13:56:00 -05:00
rm -rf vendor
2020-06-21 06:17:09 -04:00
bash -c 'vndr |& grep -v -i clone | tee ./vndr.log'
2017-05-17 12:08:50 -04:00
scripts/validate/check-git-diff vendor
2020-06-21 06:17:09 -04:00
scripts/validate/check-all-packages-vendored
2017-05-09 15:37:22 -04:00
2018-01-02 09:47:31 -05:00
.PHONY : authors
authors : ## generate AUTHORS file from git history
scripts/docs/generate-authors.sh
2017-05-10 21:24:32 -04:00
.PHONY : manpages
2017-07-19 11:44:39 -04:00
manpages : ## generate man pages from go source and markdown
2017-06-06 00:59:50 -04:00
scripts/docs/generate-man.sh
2017-05-10 21:24:32 -04:00
.PHONY : yamldocs
2017-07-19 11:44:39 -04:00
yamldocs : ## generate documentation YAML files consumed by docs repo
2017-05-10 21:24:32 -04:00
scripts/docs/generate-yaml.sh
2017-07-19 11:44:39 -04:00
.PHONY : help
help : ## print this help
2019-01-10 07:30:03 -05:00
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {gsub("\\\\n",sprintf("\n%22c",""), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $( MAKEFILE_LIST)
2017-07-19 11:44:39 -04:00
2017-08-15 14:32:44 -04:00
.PHONY : ci -validate
ci-validate :
time make -B vendor
time make manpages
time make yamldocs