aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPetr Sabata <psabata@redhat.com>2011-05-10 09:31:43 +0200
committerPetr Sabata <psabata@redhat.com>2011-05-10 09:31:43 +0200
commitf3cd56e3d361e955466ee9539fb4d0b71053fb62 (patch)
treeb535bf188f49bdb9fdd4f0972aba16c2ee9a8ece /Makefile
parentfdafbf72b7eeb8c2395204aaf4ebd9931cf47436 (diff)
Support DESTDIR
GNU coding standard recommends supporting DESTDIR in projects Makefiles. This is already expected by many GNU/Linux distributions. This patch adds DESTDIR support to sxiv Makefile. Signed-off-by: Petr Sabata <psabata@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index f7cde25..0cc621a 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@ all: sxiv
VERSION=0.8.1
CC?=gcc
+DESTDIR?=
PREFIX?=/usr/local
CFLAGS+= -Wall -pedantic -DVERSION=\"$(VERSION)\"
LDFLAGS+=
@@ -18,10 +19,10 @@ sxiv: $(OBJFILES)
$(CC) $(CFLAGS) -c -o $@ $<
install: all
- install -D -m 755 -o root -g root sxiv $(PREFIX)/bin/sxiv
- mkdir -p $(PREFIX)/share/man/man1
- sed "s/VERSION/$(VERSION)/g" sxiv.1 > $(PREFIX)/share/man/man1/sxiv.1
- chmod 644 $(PREFIX)/share/man/man1/sxiv.1
+ install -D -m 755 -o root -g root sxiv ${DESTDIR}$(PREFIX)/bin/sxiv
+ mkdir -p ${DESTDIR}$(PREFIX)/share/man/man1
+ sed "s/VERSION/$(VERSION)/g" sxiv.1 > ${DESTDIR}$(PREFIX)/share/man/man1/sxiv.1
+ chmod 644 ${DESTDIR}$(PREFIX)/share/man/man1/sxiv.1
clean:
rm -f sxiv *.o