All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2-next v2] Makefile: use make -C to change directory
@ 2019-06-13 17:59 Andrea Claudi
  2019-06-13 20:52 ` Matteo Croce
  2019-06-14 13:55 ` David Ahern
  0 siblings, 2 replies; 3+ messages in thread
From: Andrea Claudi @ 2019-06-13 17:59 UTC (permalink / raw)
  To: netdev; +Cc: stephen, dsahern

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 in testsuite/iproute2/Makefile

Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
---
 Makefile                    | 3 ++-
 testsuite/Makefile          | 6 +++---
 testsuite/iproute2/Makefile | 6 +++---
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 48f469b0d0a85..a87826fee84dd 100644
--- a/Makefile
+++ b/Makefile
@@ -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 7f247bbc1c803..94a4a8c646ef7 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 b8a7d5153175a..f8946058b3a99 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
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2-next v2] Makefile: use make -C to change directory
  2019-06-13 17:59 [PATCH iproute2-next v2] Makefile: use make -C to change directory Andrea Claudi
@ 2019-06-13 20:52 ` Matteo Croce
  2019-06-14 13:55 ` David Ahern
  1 sibling, 0 replies; 3+ messages in thread
From: Matteo Croce @ 2019-06-13 20:52 UTC (permalink / raw)
  To: Andrea Claudi; +Cc: netdev, Stephen Hemminger, David Ahern

On Thu, Jun 13, 2019 at 8:02 PM Andrea Claudi <aclaudi@redhat.com> wrote:
>
> 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 in testsuite/iproute2/Makefile
>
> Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
>

Reviewed-and-tested-by: Matteo Croce <mcroce@redhat.com>

-- 
Matteo Croce
per aspera ad upstream

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2-next v2] Makefile: use make -C to change directory
  2019-06-13 17:59 [PATCH iproute2-next v2] Makefile: use make -C to change directory Andrea Claudi
  2019-06-13 20:52 ` Matteo Croce
@ 2019-06-14 13:55 ` David Ahern
  1 sibling, 0 replies; 3+ messages in thread
From: David Ahern @ 2019-06-14 13:55 UTC (permalink / raw)
  To: Andrea Claudi, netdev; +Cc: stephen, dsahern

On 6/13/19 11:59 AM, Andrea Claudi wrote:
> 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 in testsuite/iproute2/Makefile
> 
> Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
> ---
>  Makefile                    | 3 ++-
>  testsuite/Makefile          | 6 +++---
>  testsuite/iproute2/Makefile | 6 +++---
>  3 files changed, 8 insertions(+), 7 deletions(-)

Looks good.
applied to iproute2-next. Thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-14 13:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-13 17:59 [PATCH iproute2-next v2] Makefile: use make -C to change directory Andrea Claudi
2019-06-13 20:52 ` Matteo Croce
2019-06-14 13:55 ` David Ahern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.