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 <nicolas.dechesne@linaro.org>
This commit is contained in:
Nicolas Dechesne
2016-06-05 22:07:46 +02:00
parent dcdc8e8603
commit bf673a675d

View File

@@ -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)