1From 3b60fa1598385fb36fef1c47f59cb08d3a6fba35 Mon Sep 17 00:00:00 2001
2From: Trevor Woerner <twoerner@gmail.com>
3Date: Fri, 4 Dec 2020 01:54:37 -0500
4Subject: [PATCH] add "install" targets to Makefiles
5
6Upstream-Status: Submitted [https://github.com/AndrewFromMelbourne/raspidmx/pull/29]
7Signed-off-by: Trevor Woerner <twoerner@gmail.com>
8---
9 Makefile                   | 3 +++
10 game/Makefile              | 4 ++++
11 lib/Makefile               | 1 +
12 life/Makefile              | 4 ++++
13 mandelbrot/Makefile        | 4 ++++
14 offscreen/Makefile         | 4 ++++
15 pngview/Makefile           | 4 ++++
16 radar_sweep/Makefile       | 4 ++++
17 radar_sweep_alpha/Makefile | 4 ++++
18 rgb_triangle/Makefile      | 4 ++++
19 spriteview/Makefile        | 4 ++++
20 test_pattern/Makefile      | 4 ++++
21 worms/Makefile             | 4 ++++
22 13 files changed, 48 insertions(+)
23
24diff --git a/Makefile b/Makefile
25index 4e14e18..4a06de9 100644
26--- a/Makefile
27+++ b/Makefile
28@@ -16,6 +16,9 @@ default :all
29 all:
30 	for target in $(TARGETS); do ($(MAKE) -C $$target); done
31
32+install:
33+	for target in $(TARGETS); do ($(MAKE) -C $$target install); done
34+
35 clean:
36 	for target in $(TARGETS); do ($(MAKE) -C $$target clean); done
37
38diff --git a/game/Makefile b/game/Makefile
39index ced9cce..6da6a6d 100644
40--- a/game/Makefile
41+++ b/game/Makefile
42@@ -15,6 +15,10 @@ all: $(BIN)
43 $(BIN): $(OBJS)
44 	$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
45
46+install: $(BIN)
47+	install -d $(DESTDIR)/usr/bin
48+	install -m 0755 $(BIN) $(DESTDIR)/usr/bin
49+
50 clean:
51 	@rm -f $(OBJS)
52 	@rm -f $(BIN)
53diff --git a/lib/Makefile b/lib/Makefile
54index 15d7c37..2765c91 100644
55--- a/lib/Makefile
56+++ b/lib/Makefile
57@@ -29,6 +29,7 @@ $(LIB): $(OBJS)
58 $(LIBPNG): $(OBJSPNG)
59 	$(AR) rcs lib$(LIBPNG).a $(OBJSPNG)
60
61+install:
62
63 clean:
64 	@rm -f $(OBJS)
65diff --git a/life/Makefile b/life/Makefile
66index 2fcb034..44f1edb 100644
67--- a/life/Makefile
68+++ b/life/Makefile
69@@ -15,6 +15,10 @@ all: $(BIN)
70 $(BIN): $(OBJS)
71 	$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -pthread -Wl,--no-whole-archive -rdynamic
72
73+install: $(BIN)
74+	install -d $(DESTDIR)/usr/bin
75+	install -m 0755 $(BIN) $(DESTDIR)/usr/bin
76+
77 clean:
78 	@rm -f $(OBJS)
79 	@rm -f $(BIN)
80diff --git a/mandelbrot/Makefile b/mandelbrot/Makefile
81index e61beb3..a6e6735 100644
82--- a/mandelbrot/Makefile
83+++ b/mandelbrot/Makefile
84@@ -15,6 +15,10 @@ all: $(BIN)
85 $(BIN): $(OBJS)
86 	$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -pthread -Wl,--no-whole-archive -rdynamic
87
88+install: $(BIN)
89+	install -d $(DESTDIR)/usr/bin
90+	install -m 0755 $(BIN) $(DESTDIR)/usr/bin
91+
92 clean:
93 	@rm -f $(OBJS)
94 	@rm -f $(BIN)
95diff --git a/offscreen/Makefile b/offscreen/Makefile
96index 2bc81b9..8d23354 100644
97--- a/offscreen/Makefile
98+++ b/offscreen/Makefile
99@@ -15,6 +15,10 @@ all: $(BIN)
100 $(BIN): $(OBJS)
101 	$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
102
103+install: $(BIN)
104+	install -d $(DESTDIR)/usr/bin
105+	install -m 0755 $(BIN) $(DESTDIR)/usr/bin
106+
107 clean:
108 	@rm -f $(OBJS)
109 	@rm -f $(BIN)
110diff --git a/pngview/Makefile b/pngview/Makefile
111index f947320..8c037ec 100644
112--- a/pngview/Makefile
113+++ b/pngview/Makefile
114@@ -15,6 +15,10 @@ all: $(BIN)
115 $(BIN): $(OBJS)
116 	$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
117
118+install: $(BIN)
119+	install -d $(DESTDIR)/usr/bin
120+	install -m 0755 $(BIN) $(DESTDIR)/usr/bin
121+
122 clean:
123 	@rm -f $(OBJS)
124 	@rm -f $(BIN)
125diff --git a/radar_sweep/Makefile b/radar_sweep/Makefile
126index 3a46150..5f814b7 100644
127--- a/radar_sweep/Makefile
128+++ b/radar_sweep/Makefile
129@@ -15,6 +15,10 @@ all: $(BIN)
130 $(BIN): $(OBJS)
131 	$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
132
133+install: $(BIN)
134+	install -d $(DESTDIR)/usr/bin
135+	install -m 0755 $(BIN) $(DESTDIR)/usr/bin
136+
137 clean:
138 	@rm -f $(OBJS)
139 	@rm -f $(BIN)
140diff --git a/radar_sweep_alpha/Makefile b/radar_sweep_alpha/Makefile
141index 5680b9b..f66c338 100644
142--- a/radar_sweep_alpha/Makefile
143+++ b/radar_sweep_alpha/Makefile
144@@ -15,6 +15,10 @@ all: $(BIN)
145 $(BIN): $(OBJS)
146 	$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
147
148+install: $(BIN)
149+	install -d $(DESTDIR)/usr/bin
150+	install -m 0755 $(BIN) $(DESTDIR)/usr/bin
151+
152 clean:
153 	@rm -f $(OBJS)
154 	@rm -f $(BIN)
155diff --git a/rgb_triangle/Makefile b/rgb_triangle/Makefile
156index 2017956..2ce779d 100644
157--- a/rgb_triangle/Makefile
158+++ b/rgb_triangle/Makefile
159@@ -15,6 +15,10 @@ all: $(BIN)
160 $(BIN): $(OBJS)
161 	$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
162
163+install: $(BIN)
164+	install -d $(DESTDIR)/usr/bin
165+	install -m 0755 $(BIN) $(DESTDIR)/usr/bin
166+
167 clean:
168 	@rm -f $(OBJS)
169 	@rm -f $(BIN)
170diff --git a/spriteview/Makefile b/spriteview/Makefile
171index 2713936..ada9277 100644
172--- a/spriteview/Makefile
173+++ b/spriteview/Makefile
174@@ -15,6 +15,10 @@ all: $(BIN)
175 $(BIN): $(OBJS)
176 	$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
177
178+install: $(BIN)
179+	install -d $(DESTDIR)/usr/bin
180+	install -m 0755 $(BIN) $(DESTDIR)/usr/bin
181+
182 clean:
183 	@rm -f $(OBJS)
184 	@rm -f $(BIN)
185diff --git a/test_pattern/Makefile b/test_pattern/Makefile
186index be434d9..1e02b0a 100644
187--- a/test_pattern/Makefile
188+++ b/test_pattern/Makefile
189@@ -15,6 +15,10 @@ all: $(BIN)
190 $(BIN): $(OBJS)
191 	$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
192
193+install: $(BIN)
194+	install -d $(DESTDIR)/usr/bin
195+	install -m 0755 $(BIN) $(DESTDIR)/usr/bin
196+
197 clean:
198 	@rm -f $(OBJS)
199 	@rm -f $(BIN)
200diff --git a/worms/Makefile b/worms/Makefile
201index 2a21a4b..c249c8c 100644
202--- a/worms/Makefile
203+++ b/worms/Makefile
204@@ -15,6 +15,10 @@ all: $(BIN)
205 $(BIN): $(OBJS)
206 	$(CC) -o $@ -Wl,--whole-archive $(OBJS) $(LDFLAGS) -Wl,--no-whole-archive -rdynamic
207
208+install: $(BIN)
209+	install -d $(DESTDIR)/usr/bin
210+	install -m 0755 $(BIN) $(DESTDIR)/usr/bin
211+
212 clean:
213 	@rm -f $(OBJS)
214 	@rm -f $(BIN)
215