nsxivf3cd56e
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.
+5 −4
1 file changed
- M Makefile +5 −4
| @@ -3,6 +3,7 @@ all: sxiv | |||
| 3 | 3 | VERSION=0.8.1 | |
| 4 | 4 | ||
| 5 | 5 | CC?=gcc | |
| 6 | + | DESTDIR?= | |
| 6 | 7 | PREFIX?=/usr/local | |
| 7 | 8 | CFLAGS+= -Wall -pedantic -DVERSION=\"$(VERSION)\" | |
| 8 | 9 | LDFLAGS+= | |
| @@ -18,10 +19,10 @@ sxiv: $(OBJFILES) | |||
| 18 | 19 | $(CC) $(CFLAGS) -c -o $@ $< | |
| 19 | 20 | ||
| 20 | 21 | install: all | |
| 21 | − | install -D -m 755 -o root -g root sxiv $(PREFIX)/bin/sxiv | |
| 22 | − | mkdir -p $(PREFIX)/share/man/man1 | |
| 23 | − | sed "s/VERSION/$(VERSION)/g" sxiv.1 > $(PREFIX)/share/man/man1/sxiv.1 | |
| 24 | − | chmod 644 $(PREFIX)/share/man/man1/sxiv.1 | |
| 22 | + | install -D -m 755 -o root -g root sxiv ${DESTDIR}$(PREFIX)/bin/sxiv | |
| 23 | + | mkdir -p ${DESTDIR}$(PREFIX)/share/man/man1 | |
| 24 | + | sed "s/VERSION/$(VERSION)/g" sxiv.1 > ${DESTDIR}$(PREFIX)/share/man/man1/sxiv.1 | |
| 25 | + | chmod 644 ${DESTDIR}$(PREFIX)/share/man/man1/sxiv.1 | |
| 25 | 26 | ||
| 26 | 27 | clean: | |
| 27 | 28 | rm -f sxiv *.o | |