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