From bf673a675db94334c5229732ef6fc46a69954ecc Mon Sep 17 00:00:00 2001 From: Nicolas Dechesne Date: Sun, 5 Jun 2016 22:07:46 +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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5ec95ed..e4c4202 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ OUT := rmtfs CFLAGS := -Wall -g -I../qrtr/lib LDFLAGS := -L../qrtr -lqrtr +prefix := /usr/local SRCS := qmi_rmtfs.c qmi_tlv.c rmtfs.c sharedmem.c storage.c util.c OBJS := $(SRCS:.c=.o) @@ -12,8 +13,8 @@ $(OUT): $(OBJS) %.c: %.qmi qmic < $< -test: $(OUT) - ./$(OUT) +install: $(OUT) + install -D -m 755 $< $(DESTDIR)$(prefix)/bin/$< clean: rm -f $(OUT) $(OBJS)