blob: e466a051265ba6fed7c57dcbb53e505272f95e1c [file] [log] [blame]
Andrew Geissler15ad1112021-01-08 16:09:43 -06001From f195ffffb133c9cda88d5eac41c0f584fd4540c9 Mon Sep 17 00:00:00 2001
2From: Trevor Woerner <twoerner@gmail.com>
3Date: Fri, 4 Dec 2020 03:48:36 -0500
4Subject: [PATCH] Makefile: reorganize
5
6Reorganize the main Makefile in order to:
71. be able to build in parallel
82. have build failures in subdirectories stop the build
9
10Now the "-j <#threads>" option can be used with 'make'.
11
12Also, if a build failure occurs in a subdirectory, this new arrangement will
13cause the build to stop and fail instead of silently ignoring it.
14
15To build simply invoke 'make' with or without a -j option.
16To install simply invoke: make TARGET=install
17To clean simply invoke: make TARGET=clean
18
Patrick Williams864cc432023-02-09 14:54:44 -060019Upstream-Status: Submitted [https://github.com/AndrewFromMelbourne/raspidmx/pull/29]
Andrew Geissler15ad1112021-01-08 16:09:43 -060020Signed-off-by: Trevor Woerner <twoerner@gmail.com>
21---
22 Makefile | 19 +++++++------------
23 1 file changed, 7 insertions(+), 12 deletions(-)
24
25diff --git a/Makefile b/Makefile
26index 4a06de9..1f9f7c4 100644
27--- a/Makefile
28+++ b/Makefile
29@@ -1,5 +1,4 @@
30-TARGETS=lib \
31- life \
32+TARGETS=life \
33 mandelbrot \
34 offscreen \
35 pngview \
36@@ -10,15 +9,11 @@ TARGETS=lib \
37 spriteview \
38 test_pattern \
39 worms
40+.PHONY: all lib install clean $(TARGETS)
41
42-default :all
43-
44-all:
45- for target in $(TARGETS); do ($(MAKE) -C $$target); done
46-
47-install:
48- for target in $(TARGETS); do ($(MAKE) -C $$target install); done
49-
50-clean:
51- for target in $(TARGETS); do ($(MAKE) -C $$target clean); done
52+all: $(TARGETS)
53
54+$(TARGETS): lib
55+ $(MAKE) -C $@ $(TARGET)
56+lib:
57+ $(MAKE) -C $@ $(TARGET)