Simplify hackery added to fix AIX build.

Borrow an idiom from the GNU build system which can handle `for'
loops over empty lists.
This commit is contained in:
Tom Fogal 2009-11-24 16:46:31 -07:00 committed by Ian Romanick
parent d8da270a2b
commit b9f4a0bd2b
1 changed files with 11 additions and 15 deletions

View File

@ -4,7 +4,7 @@ TOP = ..
include $(TOP)/configs/current
SUBDIRS = "$(strip "$(PROGRAM_DIRS)")"
SUBDIRS = $(PROGRAM_DIRS)
default: message subdirs
@ -15,22 +15,18 @@ message:
subdirs:
@if test -n "$(SUBDIRS)" ; then \
for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
fi \
done \
fi
@list='$(SUBDIRS)'; for dir in $$list ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
fi \
done
# Dummy install target
install:
clean:
-@if test -n "$(SUBDIRS)" ; then \
for dir in $(SUBDIRS) tests ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean) ; \
fi \
done \
fi
@list='$(SUBDIRS)'; for dir in $$list tests ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean) ; \
fi \
done