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

Commit beb2820

Browse files
kolyshkinTibor Vass
authored andcommitted
Makefile: rely on targets in deb/rpm
Instead of dynamically getting list of distros to build for, rely on the corresponding targets in sub-Makefiles. This also ensures that deb/Makefile and rpm/Makefile will have up-to-date list of distros included. This also fixes the following bug: > $ make deb > for p in raspbian-stretch ubuntu-bionic ubuntu-disco ubuntu-xenial debbuild/ubuntu-disco ubuntu-cosmic debian-buster debian-stretch; do \ > ... As you can see, `debbuild/ubuntu-disco` should not be included but it is. Could be prevented by using `-maxdepth 1` argument to `find`. While at it, amend the sub-Makefiles to print out the distro that we build for. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> (cherry picked from commit 8ac858c) Signed-off-by: Guillaume Lours <guillaume.lours@docker.com> Upstream-commit: fab64a82954642c0050741233dee1c6633e23c02 Component: packaging
1 parent 2b8e543 commit beb2820

3 files changed

Lines changed: 4 additions & 8 deletions

File tree

components/packaging/Makefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,12 @@ clean: clean-image ## remove build artifacts
2727
$(MAKE) -C static clean
2828

2929
.PHONY: rpm
30-
rpm: DOCKER_BUILD_PKGS:=$(shell find rpm -type d | grep ".*-.*" | sed 's/^rpm\///')
3130
rpm: ## build rpm packages
32-
for p in $(DOCKER_BUILD_PKGS); do \
33-
$(MAKE) -C $@ VERSION=$(VERSION) ENGINE_DIR=$(ENGINE_DIR) CLI_DIR=$(CLI_DIR) GO_VERSION=$(GO_VERSION) $${p}; \
34-
done
31+
$(MAKE) -C $@ VERSION=$(VERSION) ENGINE_DIR=$(ENGINE_DIR) CLI_DIR=$(CLI_DIR) GO_VERSION=$(GO_VERSION) rpm
3532

3633
.PHONY: deb
37-
deb: DOCKER_BUILD_PKGS:=$(shell find deb -type d | grep ".*-.*" | sed 's/^deb\///')
3834
deb: ## build deb packages
39-
for p in $(DOCKER_BUILD_PKGS); do \
40-
$(MAKE) -C $@ VERSION=$(VERSION) ENGINE_DIR=$(ENGINE_DIR) CLI_DIR=$(CLI_DIR) GO_VERSION=$(GO_VERSION) $${p}; \
41-
done
35+
$(MAKE) -C $@ VERSION=$(VERSION) ENGINE_DIR=$(ENGINE_DIR) CLI_DIR=$(CLI_DIR) GO_VERSION=$(GO_VERSION) deb
4236

4337
.PHONY: static
4438
static: DOCKER_BUILD_PKGS:=static-linux cross-mac cross-win cross-arm

components/packaging/deb/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ raspbian: $(RASPBIAN_VERSIONS) ## build all raspbian deb packages
7272

7373
.PHONY: $(DISTROS)
7474
$(DISTROS): $(SOURCES)
75+
@echo "== Building packages for $@ =="
7576
$(BUILD)
7677
$(RUN)
7778
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@

components/packaging/rpm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ centos: $(CENTOS_RELEASES) ## build all centos rpm packages
7171

7272
.PHONY: $(FEDORA_RELEASES) $(CENTOS_RELEASES)
7373
$(FEDORA_RELEASES) $(CENTOS_RELEASES): $(SOURCES)
74+
@echo "== Building packages for $@ =="
7475
$(CHOWN) -R root:root rpmbuild
7576
$(BUILD)
7677
$(RUN)

0 commit comments

Comments
 (0)