Andrew Geissler | 15ad111 | 2021-01-08 16:09:43 -0600 | [diff] [blame] | 1 | From f195ffffb133c9cda88d5eac41c0f584fd4540c9 Mon Sep 17 00:00:00 2001 |
| 2 | From: Trevor Woerner <twoerner@gmail.com> |
| 3 | Date: Fri, 4 Dec 2020 03:48:36 -0500 |
| 4 | Subject: [PATCH] Makefile: reorganize |
| 5 | |
| 6 | Reorganize the main Makefile in order to: |
| 7 | 1. be able to build in parallel |
| 8 | 2. have build failures in subdirectories stop the build |
| 9 | |
| 10 | Now the "-j <#threads>" option can be used with 'make'. |
| 11 | |
| 12 | Also, if a build failure occurs in a subdirectory, this new arrangement will |
| 13 | cause the build to stop and fail instead of silently ignoring it. |
| 14 | |
| 15 | To build simply invoke 'make' with or without a -j option. |
| 16 | To install simply invoke: make TARGET=install |
| 17 | To clean simply invoke: make TARGET=clean |
| 18 | |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame^] | 19 | Upstream-Status: Submitted [https://github.com/AndrewFromMelbourne/raspidmx/pull/29] |
Andrew Geissler | 15ad111 | 2021-01-08 16:09:43 -0600 | [diff] [blame] | 20 | Signed-off-by: Trevor Woerner <twoerner@gmail.com> |
| 21 | --- |
| 22 | Makefile | 19 +++++++------------ |
| 23 | 1 file changed, 7 insertions(+), 12 deletions(-) |
| 24 | |
| 25 | diff --git a/Makefile b/Makefile |
| 26 | index 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) |