From 6edc9372f09aaaca93530cc9283c735ffebf8e5e Mon Sep 17 00:00:00 2001
From: Bjorn Andersson <bjorn.andersson@linaro.org>
Date: Mon, 6 Nov 2017 22:55:11 -0800
Subject: [PATCH] Makefile: implement GNU Coding Standard for Makefiles

GNU coding standards notably specifies:
 * install files with the $(DESTDIR) to the target system image
 * install files with the $(prefix), not $(PREFIX)
 * the default value of $(prefix) should be /usr/local

as per
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html.

Suggested-by: Kirill Kapranov <kkapra@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Makefile b/Makefile
index e1ae942..25c3970 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,7 @@ OUT := qdl
 
 CFLAGS := -O2 -Wall -g `xml2-config --cflags`
 LDFLAGS := `xml2-config --libs`
+prefix := /usr/local
 
 SRCS := firehose.c qdl.c sahara.c util.c patch.c program.c
 OBJS := $(SRCS:.c=.o)
@@ -11,3 +12,6 @@ $(OUT): $(OBJS)
 
 clean:
 	rm -f $(OUT) $(OBJS)
+
+install: $(OUT)
+	install -D -m 755 $< $(DESTDIR)$(prefix)/bin/$<
-- 
GitLab