From d42cf61564122d4014e1797d916c99b1ecde416e Mon Sep 17 00:00:00 2001 From: Nicolas Dechesne Date: Sun, 5 Jun 2016 21:40:06 +0200 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. Signed-off-by: Nicolas Dechesne --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3bb0ca6..0783e49 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ OUT := qmic CFLAGS := -Wall -g -O2 LDFLAGS := +prefix := /usr/local SRCS := qmic.c qmi_message.c qmi_struct.c OBJS := $(SRCS:.c=.o) @@ -10,7 +11,7 @@ $(OUT): $(OBJS) $(CC) $(LDFLAGS) -o $@ $^ install: $(OUT) - install -D -m 755 $< $(PREFIX)/bin/$< + install -D -m 755 $< $(DESTDIR)$(prefix)/bin/$< clean: rm -f $(OUT) $(OBJS)