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>
This commit is contained in:
Родитель
62a8258474
Коммит
8ac858c666
10
Makefile
10
Makefile
|
@ -36,18 +36,12 @@ clean: clean-image ## remove build artifacts
|
|||
$(MAKE) -C static clean
|
||||
|
||||
.PHONY: rpm
|
||||
rpm: DOCKER_BUILD_PKGS:=$(shell find rpm -type d | grep ".*-.*" | sed 's/^rpm\///')
|
||||
rpm: ## build rpm packages
|
||||
for p in $(DOCKER_BUILD_PKGS); do \
|
||||
$(MAKE) -C $@ VERSION=$(VERSION) ENGINE_DIR=$(ENGINE_DIR) CLI_DIR=$(CLI_DIR) GO_VERSION=$(GO_VERSION) $${p}; \
|
||||
done
|
||||
$(MAKE) -C $@ VERSION=$(VERSION) ENGINE_DIR=$(ENGINE_DIR) CLI_DIR=$(CLI_DIR) GO_VERSION=$(GO_VERSION) rpm
|
||||
|
||||
.PHONY: deb
|
||||
deb: DOCKER_BUILD_PKGS:=$(shell find deb -type d | grep ".*-.*" | sed 's/^deb\///')
|
||||
deb: ## build deb packages
|
||||
for p in $(DOCKER_BUILD_PKGS); do \
|
||||
$(MAKE) -C $@ VERSION=$(VERSION) ENGINE_DIR=$(ENGINE_DIR) CLI_DIR=$(CLI_DIR) GO_VERSION=$(GO_VERSION) $${p}; \
|
||||
done
|
||||
$(MAKE) -C $@ VERSION=$(VERSION) ENGINE_DIR=$(ENGINE_DIR) CLI_DIR=$(CLI_DIR) GO_VERSION=$(GO_VERSION) deb
|
||||
|
||||
.PHONY: static
|
||||
static: DOCKER_BUILD_PKGS:=static-linux cross-mac cross-win cross-arm
|
||||
|
|
|
@ -73,6 +73,7 @@ raspbian: $(RASPBIAN_VERSIONS) ## build all raspbian deb packages
|
|||
|
||||
.PHONY: $(DISTROS)
|
||||
$(DISTROS): $(SOURCES)
|
||||
@echo "== Building packages for $@ =="
|
||||
$(BUILD)
|
||||
$(RUN)
|
||||
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
|
||||
|
|
|
@ -71,6 +71,7 @@ centos: $(CENTOS_RELEASES) ## build all centos rpm packages
|
|||
|
||||
.PHONY: $(FEDORA_RELEASES) $(CENTOS_RELEASES)
|
||||
$(FEDORA_RELEASES) $(CENTOS_RELEASES): $(SOURCES)
|
||||
@echo "== Building packages for $@ =="
|
||||
$(CHOWN) -R root:root rpmbuild
|
||||
$(BUILD)
|
||||
$(RUN)
|
||||
|
|
Загрузка…
Ссылка в новой задаче