diff options
author | Andrea Claudi <aclaudi@redhat.com> | 2019-06-13 19:47:02 +0200 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2019-06-18 09:52:58 -0700 |
commit | 8063feebbace60d1d6e11a09a589a8799d1125a3 (patch) | |
tree | dd55b9f41be1e2f27e6dc63f0596b7fd4f9e7a8b | |
parent | 77a380379f270d28a771487f964bb7928ac34285 (diff) | |
download | iproute2-8063feebbace60d1d6e11a09a589a8799d1125a3.tar.gz |
Makefile: use make -C
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>
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | testsuite/Makefile | 6 | ||||
-rw-r--r-- | testsuite/iproute2/Makefile | 6 |
3 files changed, 8 insertions, 7 deletions
@@ -114,7 +114,8 @@ clobber: 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; \ diff --git a/testsuite/Makefile b/testsuite/Makefile index d5408646..4451f316 100644 --- a/testsuite/Makefile +++ b/testsuite/Makefile @@ -26,10 +26,10 @@ endif .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 \ @@ -51,7 +51,7 @@ clean: testclean $(MAKE) -C tools clean distclean: clean - echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..; + $(MAKE) -C iproute2 distclean $(TESTS): generate_nlmsg testclean ifeq (,$(IPVERS)) diff --git a/testsuite/iproute2/Makefile b/testsuite/iproute2/Makefile index b8a7d515..f8946058 100644 --- a/testsuite/iproute2/Makefile +++ b/testsuite/iproute2/Makefile @@ -4,7 +4,7 @@ SUBDIRS := $(filter-out Makefile,$(wildcard *)) all: configure @for dir in $(SUBDIRS); do \ - echo "Entering $$dir" && cd $$dir && $(MAKE) && cd ..; \ + $(MAKE) -C $$dir; \ done link: @@ -19,12 +19,12 @@ configure: 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 |