hc
2023-11-20 2e7bd41e4e8ab3d1efdabd9e263a2f7fe79bff8c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 905bc741b189d67160b27551b8ad01459c2707a0 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Fri, 2 Dec 2016 23:10:37 +0100
Subject: [PATCH] Makefile: add DESTDIR support
 
This allows installing rpiboot outside of /usr if needed.
 
Submitted-upstream: https://github.com/raspberrypi/usbboot/pull/2
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Arnout: remove /usr]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 Makefile | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
 
diff --git a/Makefile b/Makefile
index d9a7220..7835b7f 100755
--- a/Makefile
+++ b/Makefile
@@ -2,18 +2,18 @@ rpiboot: main.c
     $(CC) -g $(CFLAGS) -o $@ $< -lusb-1.0 $(LDFLAGS)
 
 install: rpiboot
-    cp rpiboot /usr/bin
-    mkdir -p /usr/share/rpiboot
-    cp usbbootcode.bin /usr/share/rpiboot
-    cp msd.elf /usr/share/rpiboot
-    cp buildroot.elf /usr/share/rpiboot
+    cp rpiboot $(DESTDIR)bin
+    mkdir -p $(DESTDIR)/share/rpiboot
+    cp usbbootcode.bin $(DESTDIR)/share/rpiboot
+    cp msd.elf $(DESTDIR)/share/rpiboot
+    cp buildroot.elf $(DESTDIR)/share/rpiboot
 
 uninstall:
-    rm -f /usr/bin/rpiboot
-    rm -f /usr/share/rpiboot/usbbootcode.bin
-    rm -f /usr/share/rpiboot/msd.elf
-    rm -f /usr/share/rpiboot/buildroot.elf
-    rmdir --ignore-fail-on-non-empty /usr/share/rpiboot/
+    rm -f $(DESTDIR)/bin/rpiboot
+    rm -f $(DESTDIR)/share/rpiboot/usbbootcode.bin
+    rm -f $(DESTDIR)/share/rpiboot/msd.elf
+    rm -f $(DESTDIR)/share/rpiboot/buildroot.elf
+    rmdir --ignore-fail-on-non-empty $(DESTDIR)/share/rpiboot/
 
 clean: 
     rm rpiboot
-- 
2.7.4