diff mbox

[v2,04/14] checkpolicy: build: follow standard semantics for DESTDIR and PREFIX

Message ID 20180116202327.23253-5-marcus.folkesson@gmail.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Marcus Folkesson Jan. 16, 2018, 8:23 p.m. UTC
This patch solves the following issues:
- DESTDIR is needed during compile time to compute library
  and header paths which it should not.
- Installing with both DESTDIR and PREFIX set gives us odd paths
- Make usage of DESTDIR and PREFIX more standard

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
 checkpolicy/Makefile      | 9 ++++-----
 checkpolicy/test/Makefile | 7 +++----
 2 files changed, 7 insertions(+), 9 deletions(-)
diff mbox

Patch

diff --git a/checkpolicy/Makefile b/checkpolicy/Makefile
index 68e11f2a..0c341d02 100644
--- a/checkpolicy/Makefile
+++ b/checkpolicy/Makefile
@@ -1,11 +1,10 @@ 
 #
 # Makefile for building the checkpolicy program
 #
-PREFIX ?= $(DESTDIR)/usr
-BINDIR ?= $(PREFIX)/bin
-MANDIR ?= $(PREFIX)/share/man
-LIBDIR ?= $(PREFIX)/lib
-INCLUDEDIR ?= $(PREFIX)/include
+PREFIX ?= /usr
+BINDIR ?= $(DESTDIR)$(PREFIX)/bin
+MANDIR ?= $(DESTDIR)$(PREFIX)/share/man
+LIBDIR ?= $(DESTDIR)$(PREFIX)/lib
 LIBSEPOLA ?= $(LIBDIR)/libsepol.a
 TARGETS = checkpolicy checkmodule
 
diff --git a/checkpolicy/test/Makefile b/checkpolicy/test/Makefile
index 59fa4460..8f4393d2 100644
--- a/checkpolicy/test/Makefile
+++ b/checkpolicy/test/Makefile
@@ -1,10 +1,9 @@ 
 #
 # Makefile for building the dispol program
 #
-PREFIX ?= $(DESTDIR)/usr
-BINDIR ?= $(PREFIX)/bin
-LIBDIR ?= $(PREFIX)/lib
-INCLUDEDIR ?= $(PREFIX)/include
+PREFIX ?= /usr
+BINDIR ?= $(DESTDIR)$(PREFIX)/bin
+LIBDIR ?= $(DESTDIR)$(PREFIX)/lib
 LIBSEPOLA ?= $(LIBDIR)/libsepol.a
 
 CFLAGS ?= -g -Wall -W -Werror -O2 -pipe