From fb614814a6218a7edefdb8b637a8c35aade092e1 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 13 Oct 2022 01:59:00 +0200 Subject: Respect DESTDIR --- Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Makefile') 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: -- cgit v1.2.3