From 458a61f6162a60d67d9db4b265601b8d20f4f9d0 Mon Sep 17 00:00:00 2001 From: Pengfei Xu Date: Tue, 28 Nov 2023 17:09:47 +0800 Subject: [PATCH 1/2] tools/Makefile: tools make will continue when it encounters subfolder making failed Signed-off-by: Pengfei Xu --- tools/Makefile | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index 362c2992..1a755618 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,18 +1,32 @@ # SPDX-License-Identifier: GPL-2.0-only # Copyright (c) 2022 Intel Corporation. -SUBDIRS = $(shell ls -d */) +TOOLSDIRS = $(shell ls -d */) +MAKE_TOOLS_LOG = /tmp/make_tools.log + all: - @for dir in $(SUBDIRS) ; do \ - if [ -f "$$dir/Makefile" ]; then \ - cd $$dir && \ - make && \ - cd .. || exit 2; \ + @cat /dev/null > ${MAKE_TOOLS_LOG}; + @for tooldir in $(TOOLSDIRS); do \ + if [ -f "$$tooldir/Makefile" ]; then \ + cd $$tooldir && \ + make || { \ + cd ..; \ + echo " - Make tools $${tooldir} failed." >> ${MAKE_TOOLS_LOG}; \ + continue; \ + }; \ + cd ..; \ fi \ done + @cat ${MAKE_TOOLS_LOG} +ifeq ($(shell cat $(MAKE_TOOLS_LOG)),) + @exit 0 +else + @exit 1 +endif + clean: - for dir in $(SUBDIRS) ; do \ - if [ -f "$$dir/Makefile" ]; then \ - make -C $$dir clean || exit 2; \ - fi \ + @for tooldir in $(TOOLSDIRS); do \ + if [ -f "$$tooldir/Makefile" ]; then \ + make -C $$tooldir clean || continue; \ + fi \ done From 3a4b1870c20857db3ea7faeb57c0ffe354457f15 Mon Sep 17 00:00:00 2001 From: Pengfei Xu Date: Tue, 28 Nov 2023 17:03:38 +0800 Subject: [PATCH 2/2] Makefile: make will continue when it encounters a subfolder making failed When make in the lkvs root path encounters a subfolder that fails to make, it will continue and all subfolders that make failed will be listed at the end. Signed-off-by: Pengfei Xu --- Makefile | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 2f121eac..fe7e5d06 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ SUBDIRS = $(shell ls -d */) PROXY := +MAKE_LKVS_LOG = /tmp/make_lkvs.log + ifneq ($(https_proxy),) PROXY := $(https_proxy) else ifneq ($(HTTPS_PROXY),) @@ -16,18 +18,30 @@ PROXY := $(ALL_PROXY) endif all: - @for dir in $(SUBDIRS) ; do \ + @cat /dev/null > ${MAKE_LKVS_LOG}; + @for dir in $(SUBDIRS); do \ if [ -f "$$dir/Makefile" ]; then \ cd $$dir && \ - make && \ - cd .. || exit 2; \ + make || { \ + echo " - Make subfolder $${dir} failed." >> ${MAKE_LKVS_LOG}; \ + cd ..; \ + continue; \ + }; \ + cd ..; \ fi \ done + cat $(MAKE_LKVS_LOG) +ifeq ($(shell cat $(MAKE_LKVS_LOG)),) + @exit 0 +else + @exit 1 +endif + clean: - for dir in $(SUBDIRS) ; do \ - if [ -f "$$dir/Makefile" ]; then \ - make -C $$dir clean || exit 2; \ - fi \ + @for dir in $(SUBDIRS); do \ + if [ -f "$$dir/Makefile" ]; then \ + make -C $$dir clean || continue; \ + fi \ done docker_clean: docker run -it --rm -v $(PWD):/src --name ubuntu_2204_lkvs ubuntu:22.04 make clean