blob: c6897b4e7e5bd7bd61e11f3a8110e0587c01f8da [file] [log] [blame]
Patrick Williamsddad1a12017-02-23 20:36:32 -06001From 5e102b453e254d16af1f95053134f58348e0f83a Mon Sep 17 00:00:00 2001
2From: root <git@andred.net>
3Date: Wed, 20 Jul 2016 23:40:30 +0100
4Subject: [PATCH 1/5] build: error out correctly if a submake fails
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Due to use of a for loop, return status from submake was always
10ignored.
11
12In the context of build-systems like OE this causes them to not
13detect any errors and continue happily, resulting in a successful,
14but incomplete, build.
15
16Fix by having a nicer Makefile.in which now has rules for the
17individual targets (directories) so that make itself can
18figure out all the dependencies and build those targets as
19needed rather than using a for loop to iterate over the
20directories in a shell and thus loosing the return status of
21the command inside the loop.
22
23This has the added advantage that parallel builds work now.
24
25Upstream-Status: Pending
26
27Signed-off-by: André Draszik <git@andred.net>
28---
29 Makefile.in | 18 ++++++++++++------
30 1 file changed, 12 insertions(+), 6 deletions(-)
31
32diff --git a/Makefile.in b/Makefile.in
33index 6028513..dab88bb 100644
34--- a/Makefile.in
35+++ b/Makefile.in
36@@ -13,11 +13,11 @@ distdir = $(PACKAGE)-$(VERSION)
37
38 SUBDIRS=libbridge brctl doc
39
40-all:
41- for x in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$x ; done
42+all: override ACTION=
43+all: $(SUBDIRS)
44
45-clean:
46- for x in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$x clean ; done
47+clean: override ACTION=clean
48+clean: $(SUBDIRS)
49
50 distclean: clean
51 rm -f config.log
52@@ -30,6 +30,12 @@ maintainer-clean: distclean
53 rm -f libbridge/Makefile
54 rm -f doc/Makefile
55
56-install:
57- for x in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$x install; done
58+install: override ACTION=install
59+install: $(SUBDIRS)
60
61+
62+brctl: libbridge
63+$(SUBDIRS):
64+ $(MAKE) $(MFLAGS) -C $@ $(ACTION)
65+
66+.PHONY: $(SUBDIRS)
67--
682.8.1
69