Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame^] | 1 | From 5e102b453e254d16af1f95053134f58348e0f83a Mon Sep 17 00:00:00 2001 |
| 2 | From: root <git@andred.net> |
| 3 | Date: Wed, 20 Jul 2016 23:40:30 +0100 |
| 4 | Subject: [PATCH 1/5] build: error out correctly if a submake fails |
| 5 | MIME-Version: 1.0 |
| 6 | Content-Type: text/plain; charset=UTF-8 |
| 7 | Content-Transfer-Encoding: 8bit |
| 8 | |
| 9 | Due to use of a for loop, return status from submake was always |
| 10 | ignored. |
| 11 | |
| 12 | In the context of build-systems like OE this causes them to not |
| 13 | detect any errors and continue happily, resulting in a successful, |
| 14 | but incomplete, build. |
| 15 | |
| 16 | Fix by having a nicer Makefile.in which now has rules for the |
| 17 | individual targets (directories) so that make itself can |
| 18 | figure out all the dependencies and build those targets as |
| 19 | needed rather than using a for loop to iterate over the |
| 20 | directories in a shell and thus loosing the return status of |
| 21 | the command inside the loop. |
| 22 | |
| 23 | This has the added advantage that parallel builds work now. |
| 24 | |
| 25 | Upstream-Status: Pending |
| 26 | |
| 27 | Signed-off-by: André Draszik <git@andred.net> |
| 28 | --- |
| 29 | Makefile.in | 18 ++++++++++++------ |
| 30 | 1 file changed, 12 insertions(+), 6 deletions(-) |
| 31 | |
| 32 | diff --git a/Makefile.in b/Makefile.in |
| 33 | index 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 | -- |
| 68 | 2.8.1 |
| 69 | |