aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2022-10-13 01:59:00 +0200
committerThomas Voss <mail@thomasvoss.com> 2022-11-13 09:22:28 +0100
commitfb614814a6218a7edefdb8b637a8c35aade092e1 (patch)
tree6af445b964e855611c7eb8f0d06ae52c2b7bad43
parent7f3c35a90e9bd7e0c8e34efc1d8ca992350919ce (diff)
Respect DESTDIR
-rw-r--r--Makefile12
1 files changed, 7 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 7657cff..1ad2154 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,11 @@
.POSIX:
+CFLAGS = -std=c11 -O3 -pipe -Wall -Wextra -Werror -pedantic
LDFLAGS = -llux
-CFLAGS = -std=c11 -O3 -pipe -Wall -Wextra -Werror -pedantic
-PREFIX = /usr
-MANDIR = ${PREFIX}/share/man
+
+PREFIX = /usr
+DPREFIX = ${DESTDIR}${PREFIX}
+MANDIR = ${DPREFIX}/share/man
target = lux
@@ -12,8 +14,8 @@ ${target}: main.c
${CC} ${CFLAGS} ${LDFLAGS} -o $@ $<
install:
- mkdir -p ${PREFIX}/bin ${MANDIR}/man1
- cp ${target} ${PREFIX}/bin
+ mkdir -p ${DPREFIX}/bin ${MANDIR}/man1
+ cp ${target} ${DPREFIX}/bin
cp *.1 ${MANDIR}/man1
clean: