Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit c6c1776

Browse files
kolyshkinTibor Vass
authored andcommitted
deb/Makefile: simplify and fix
1. A symbol % is not working as expected in PHONY targets, so e.g. ubuntu-cosmic was not being rebuild each time, because ubuntu-cosmic directory exists. The fix is to explicitly mark every ubuntu-whatever target as phony. 2. Remove code duplication for making packages for different distros. 3. Add missing ubuntu (cosmic, disco) and debian (buster) to the appropriate targets. 4. As a side effect, bash completion now lists all the distros to be build. 5. Exclude raspbian from deb target as it can only be built on ARM. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> (cherry picked from commit c048fc8) Signed-off-by: Guillaume Lours <guillaume.lours@docker.com> Upstream-commit: 92b35fb0c64dedec3b820da6ce486b8501354136 Component: packaging
1 parent 0050cf5 commit c6c1776

1 file changed

Lines changed: 11 additions & 21 deletions

File tree

components/packaging/deb/Makefile

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ RUN=docker run --rm -i \
3737
SOURCE_FILES=engine-image cli.tgz engine.tgz docker.service docker.socket distribution_based_engine.json plugin-installers.tgz
3838
SOURCES=$(addprefix sources/, $(SOURCE_FILES))
3939

40+
DEBIAN_VERSIONS := debian-stretch debian-buster
41+
UBUNTU_VERSIONS := ubuntu-xenial ubuntu-bionic ubuntu-cosmic ubuntu-disco
42+
RASPBIAN_VERSIONS := raspbian-stretch raspbian-buster
43+
DISTROS := $(DEBIAN_VERSIONS) $(UBUNTU_VERSIONS) $(RASPBIAN_VERSIONS)
44+
4045
.PHONY: help
4146
help: ## show make targets
4247
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
@@ -54,34 +59,19 @@ engine-$(ARCH).tar:
5459
docker save -o $@ $$(cat ../image/image-linux)
5560

5661
.PHONY: deb
57-
deb: ubuntu debian raspbian ## build all deb packages
62+
deb: ubuntu debian ## build all deb packages except for raspbian
5863

5964
.PHONY: ubuntu
60-
ubuntu: ubuntu-bionic ubuntu-xenial ubuntu-disco ubuntu-eoan ## build all ubuntu deb packages
65+
ubuntu: $(UBUNTU_VERSIONS) ## build all ubuntu deb packages
6166

6267
.PHONY: debian
63-
debian: debian-stretch debian-buster ## build all debian deb packages
68+
debian: $(DEBIAN_VERSIONS) ## build all debian deb packages
6469

6570
.PHONY: raspbian
66-
raspbian: raspbian-stretch raspbian-buster ## build all raspbian deb packages
67-
68-
.PHONY: ubuntu-%
69-
## build ubuntu deb packages
70-
ubuntu-%: $(SOURCES)
71-
$(BUILD)
72-
$(RUN)
73-
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
74-
75-
.PHONY: debian-%
76-
## build debian deb packages
77-
debian-%: $(SOURCES)
78-
$(BUILD)
79-
$(RUN)
80-
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
71+
raspbian: $(RASPBIAN_VERSIONS) ## build all raspbian deb packages
8172

82-
.PHONY: raspbian-%
83-
## build raspbian deb packages
84-
raspbian-%: $(SOURCES)
73+
.PHONY: $(DISTROS)
74+
$(DISTROS): $(SOURCES)
8575
$(BUILD)
8676
$(RUN)
8777
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@

0 commit comments

Comments
 (0)