make provides a handy -C option to change directory before reading
the makefiles or doing anything else.
Use that instead of the "cd dir && make && cd .." pattern, thus
simplifying sintax for some makefiles.
Changes from v1:
- Drop an obviously wrong leftover on testsuite/iproute2/Makefile
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
distclean: clobber
check: all
- cd testsuite && $(MAKE) && $(MAKE) alltests
+ $(MAKE) -C testsuite
+ $(MAKE) -C testsuite alltests
@if command -v man >/dev/null 2>&1; then \
echo "Checking manpages for syntax errors..."; \
$(MAKE) -C man check; \
.PHONY: compile listtests alltests configure $(TESTS)
configure:
- echo "Entering iproute2" && cd iproute2 && $(MAKE) configure && cd ..;
+ $(MAKE) -C iproute2 configure
compile: configure generate_nlmsg
- echo "Entering iproute2" && cd iproute2 && $(MAKE) && cd ..;
+ $(MAKE) -C iproute2
listtests:
@for t in $(TESTS); do \
$(MAKE) -C tools clean
distclean: clean
- echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..;
+ $(MAKE) -C iproute2 distclean
$(TESTS): generate_nlmsg testclean
ifeq (,$(IPVERS))
all: configure
@for dir in $(SUBDIRS); do \
- echo "Entering $$dir" && cd $$dir && $(MAKE) && cd ..; \
+ $(MAKE) -C $$dir; \
done
link:
clean: link
@for dir in $(SUBDIRS); do \
- echo "Entering $$dir" && cd $$dir && $(MAKE) clean && cd ..; \
+ $(MAKE) -C $$dir clean; \
done
distclean: clean
@for dir in $(SUBDIRS); do \
- echo "Entering $$dir" && cd $$dir && $(MAKE) distclean && cd ..; \
+ $(MAKE) -C $$dir distclean; \
done
show: link