[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-bridge
Subject:    [Bridge] [PATCH 1/4] bridge-utils: Abort compilation on error in any subdirectory
From:       Andrey Mazo <mazo () telum ! ru>
Date:       2014-02-21 12:58:38
Message-ID: 1392987521-2289-2-git-send-email-mazo () telum ! ru
[Download RAW message or body]

Currently bridge-utils makefile ignores compilation errors in
subdirectories, stepping into consecutive subdirs and finally
returning exit status of the last subdirectory's make.
The last subdirectory is now "doc", which has nothing to do for target "all",
so global `make all` always succeeds, effectively ignoring any build
errors in "libbridge" and "brctl" subdirectories.
This behaviour is odd as it breaks anyone relying on make's exit status.
For example, see Gentoo bug #483692 [1].

Fix this by simply aborting make on the first error.
Don't inspect MAKEFLAGS for -k for simplicity.

[1] https://bugs.gentoo.org/show_bug.cgi?id=483692

Signed-off-by: Andrey Mazo <mazo@telum.ru>
---
 Makefile.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 2f2fcba..5aed223 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -14,7 +14,7 @@ distdir = $(PACKAGE)-$(VERSION)
 SUBDIRS=libbridge brctl doc
 
 all:
-	for x in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$x ; done
+	for x in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$x || exit 1 ; done
 
 clean:
 	for x in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$x clean ; done
@@ -28,5 +28,5 @@ maintainer-clean: distclean
 	rm -f brctl/Makefile libbridge/Makefile doc/Makefile
 
 install:
-	for x in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$x install; done
+	for x in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$x install || exit 1 ; done
 
-- 
1.8.4.5

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic