changeset 545:7f0ff7fcdf64

Set 'prefix' depending on 'DESTDIR'.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Wed, 21 Nov 2012 00:42:36 +0200
parents 075644e534a3
children 90459a37d38a
files printarg/Makefile
diffstat 1 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/printarg/Makefile	Wed Nov 21 00:23:22 2012 +0200
+++ b/printarg/Makefile	Wed Nov 21 00:42:36 2012 +0200
@@ -33,17 +33,19 @@
 ################################################################
 # Installation directories.
 
-ifeq '' '$(DESTDIR)$(prefix)'
-  ifneq '' '$(HOME)'
-    prefix = $(HOME)/usr
-  else
+ifeq '' '$(DESTDIR)'
+  ifeq '' '$(HOME)'
     $(error HOME env var and prefix var are not set!)
   endif
+  prefix = $(HOME)/usr
+else
+  prefix = /usr
 endif
 
-bindir = $(DESTDIR)$(prefix)/bin
-mandir = $(DESTDIR)$(prefix)/share/man
-man1dir = $(DESTDIR)$(mandir)/man1
+bindir := $(DESTDIR)$(prefix)/bin
+datadir := $(DESTDIR)$(prefix)/share
+mandir := $(datadir)/man
+man1dir := $(mandir)/man1
 
 ################################################################
 # Platform definition.