2019-08-15 00:48:38 +03:00
|
|
|
include common.mk
|
|
|
|
|
2020-04-23 14:38:20 +03:00
|
|
|
STATIC_VERSION=$(shell static/gen-static-ver $(realpath $(CURDIR)/src/github.com/docker/docker) $(VERSION))
|
2017-05-20 08:11:06 +03:00
|
|
|
|
2018-08-02 21:32:44 +03:00
|
|
|
# Taken from: https://www.cmcrossroads.com/article/printing-value-makefile-variable
|
|
|
|
print-% : ; @echo $($*)
|
|
|
|
|
2017-12-28 03:26:04 +03:00
|
|
|
.PHONY: help
|
2017-05-20 08:11:06 +03:00
|
|
|
help: ## show make targets
|
|
|
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
|
|
|
|
2020-04-23 14:38:20 +03:00
|
|
|
.PHONY: clean-src
|
|
|
|
clean-src:
|
|
|
|
[ ! -d src ] || $(CHOWN) -R $(shell id -u):$(shell id -g) src
|
|
|
|
$(RM) -r src
|
|
|
|
|
|
|
|
.PHONY: src
|
|
|
|
src: src/github.com/docker/cli src/github.com/docker/docker ## clone source
|
|
|
|
|
|
|
|
ifdef CLI_DIR
|
|
|
|
src/github.com/docker/cli:
|
|
|
|
mkdir -p "$(@D)"
|
|
|
|
cp -r "$(CLI_DIR)" $@
|
|
|
|
else
|
|
|
|
src/github.com/docker/cli:
|
2020-04-23 15:07:53 +03:00
|
|
|
git init $@
|
|
|
|
git -C $@ remote add origin "$(DOCKER_CLI_REPO)"
|
2020-04-23 14:38:20 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef ENGINE_DIR
|
|
|
|
src/github.com/docker/docker:
|
|
|
|
mkdir -p "$(@D)"
|
|
|
|
cp -r "$(ENGINE_DIR)" $@
|
|
|
|
else
|
|
|
|
src/github.com/docker/docker:
|
2020-04-23 15:07:53 +03:00
|
|
|
git init $@
|
|
|
|
git -C $@ remote add origin "$(DOCKER_ENGINE_REPO)"
|
2020-04-23 14:38:20 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: checkout-cli
|
|
|
|
checkout-cli: src/github.com/docker/cli
|
2020-04-23 15:07:53 +03:00
|
|
|
@git -C src/github.com/docker/cli fetch --depth 1 origin "$(DOCKER_CLI_REF)"
|
|
|
|
@git -C src/github.com/docker/cli checkout -q FETCH_HEAD
|
2020-04-23 14:38:20 +03:00
|
|
|
|
|
|
|
.PHONY: checkout-docker
|
|
|
|
checkout-docker: src/github.com/docker/docker
|
2020-04-23 15:07:53 +03:00
|
|
|
@git -C src/github.com/docker/docker fetch --depth 1 origin "$(DOCKER_ENGINE_REF)"
|
|
|
|
@git -C src/github.com/docker/docker checkout -q FETCH_HEAD
|
2020-04-23 14:38:20 +03:00
|
|
|
|
|
|
|
.PHONY: checkout
|
|
|
|
checkout: checkout-cli checkout-docker ## checkout source at the given reference(s)
|
2018-08-02 21:32:44 +03:00
|
|
|
|
2017-12-28 03:26:04 +03:00
|
|
|
.PHONY: clean
|
2020-04-23 14:38:20 +03:00
|
|
|
clean: clean-src ## remove build artifacts
|
2017-05-20 08:11:06 +03:00
|
|
|
$(MAKE) -C rpm clean
|
|
|
|
$(MAKE) -C deb clean
|
|
|
|
$(MAKE) -C static clean
|
|
|
|
|
2017-12-28 03:26:04 +03:00
|
|
|
.PHONY: rpm
|
2020-04-23 14:38:20 +03:00
|
|
|
rpm: checkout ## build rpm packages
|
|
|
|
$(MAKE) -C $@ VERSION=$(VERSION) GO_VERSION=$(GO_VERSION) rpm
|
2017-05-20 08:11:06 +03:00
|
|
|
|
2017-12-28 03:26:04 +03:00
|
|
|
.PHONY: deb
|
2020-04-23 14:38:20 +03:00
|
|
|
deb: checkout ## build deb packages
|
|
|
|
$(MAKE) -C $@ VERSION=$(VERSION) GO_VERSION=$(GO_VERSION) deb
|
2017-05-20 08:11:06 +03:00
|
|
|
|
2017-12-28 03:26:04 +03:00
|
|
|
.PHONY: static
|
2017-05-20 08:11:06 +03:00
|
|
|
static: DOCKER_BUILD_PKGS:=static-linux cross-mac cross-win cross-arm
|
2020-04-23 14:38:20 +03:00
|
|
|
static: checkout ## build static-compiled packages
|
2017-05-20 08:11:06 +03:00
|
|
|
for p in $(DOCKER_BUILD_PKGS); do \
|
2020-04-23 14:38:20 +03:00
|
|
|
$(MAKE) -C $@ VERSION=$(VERSION) GO_VERSION=$(GO_VERSION) $${p}; \
|
2017-05-20 08:11:06 +03:00
|
|
|
done
|