From 3d5735acee598a5f11bb17e46aec17de2d3e6ab9 Mon Sep 17 00:00:00 2001 From: maxice8 Date: Tue, 18 Sep 2018 17:10:31 -0300 Subject: [PATCH] Makefile: Fix installation and stripping - Separate stripping into another step of the package - Conditionalize stripping the binary, distros don't like when packages do it because they want the debug symbols included and do their own stripping after extracting them - use -Dm755 to create the directory (-D) and set the correct executable mode - respect PREFIX which can be set to /usr /usr/local and even / - respect DESTDIR which is set by distros when they are packaging --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 719c964..5adcacd 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,11 @@ CC?=cc CFLAGS?=-std=c99 -pedantic -Wall -Os +STRIP?=strip +PREFIX?=/usr all: ${CC} ${CFLAGS} -o find-cursor find-cursor.c -lX11 -lXext -lXfixes install: - install --strip -o root -g root find-cursor /bin/ + $(STRIP) find-cursor + install -Dm755 find-cursor $(DESTDIR)$(PREFIX)/bin/find-cursor