Skip to content

Commit

Permalink
tools/Makefile: tools make will continue when it encounters subfolder…
Browse files Browse the repository at this point in the history
… making failed

Signed-off-by: Pengfei Xu <[email protected]>
  • Loading branch information
xupengfe authored and ysun committed Nov 30, 2023
1 parent 7b288b9 commit 539d0a3
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions tools/Makefile
Original file line number Diff line number Diff line change
@@ -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 2
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

0 comments on commit 539d0a3

Please sign in to comment.