1SUBDIRS := $(filter-out Makefile,$(wildcard *)) 2.PHONY: all configure clean distclean show $(SUBDIRS) 3 4all: configure 5 @for dir in $(SUBDIRS); do \ 6 echo "Entering $$dir" && cd $$dir && $(MAKE) && cd ..; \ 7 done 8 9link: 10 @if [ ! -L iproute2-this ]; then \ 11 ln -s ../.. iproute2-this; \ 12 fi 13 14configure: link 15 @for dir in $(SUBDIRS); do \ 16 echo "Entering $$dir" && cd $$dir && if [ -f configure ]; then ./configure; fi && cd ..; \ 17 done 18 19clean: link 20 @for dir in $(SUBDIRS); do \ 21 echo "Entering $$dir" && cd $$dir && $(MAKE) clean && cd ..; \ 22 done 23 24distclean: clean 25 @for dir in $(SUBDIRS); do \ 26 echo "Entering $$dir" && cd $$dir && $(MAKE) distclean && cd ..; \ 27 done 28 29show: link 30 @echo "$(SUBDIRS)" 31 32$(SUBDIRS): 33 cd $@ && $(MAKE) 34