From 8636e34a668aafa948e53c878a5458fe2bc9e8f7 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Thu, 12 Jul 2007 16:47:37 +0000 Subject: [PATCH] Make the install target of man-pages respect the standard "DESTDIR" variable as well as check the exit status of the install command so errors aren't ignored. --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 90476eefc..8f5db0597 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ # Do "make install" to copy the pages to their destination. # Do "make gz" or "make bz2" first if you use compressed source pages. +DESTDIR= prefix?=/usr MANDIR=$(prefix)/share/man @@ -48,11 +49,11 @@ html: done; \ done; fi -README=$(MANDIR)/man1/README +README=$(DESTDIR)$(MANDIR)/man1/README install: for i in man? man??; do \ - install -d -m 755 $(MANDIR)/"$$i"; \ - install -m 644 "$$i"/* $(MANDIR)/"$$i"; \ + install -d -m 755 $(DESTDIR)$(MANDIR)/"$$i" || exit $$?; \ + install -m 644 "$$i"/* $(DESTDIR)$(MANDIR)/"$$i" || exit $$?; \ done; \ rm -f $(README) $(README).gz $(README).bz2