From a46776cdcf32c25a2bad4b1c3f0eea3dadfad0aa Mon Sep 17 00:00:00 2001 From: Marcus Folkesson Date: Wed, 14 Feb 2018 10:57:17 +0100 Subject: [PATCH] build: setup buildpaths if DESTDIR is specified Signed-off-by: Marcus Folkesson --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6da7f7b7..c238dbc8 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ +PREFIX ?= /usr OPT_SUBDIRS ?= dbus gui mcstrans python restorecond sandbox semodule-utils SUBDIRS=libsepol libselinux libsemanage checkpolicy secilc policycoreutils $(OPT_SUBDIRS) PYSUBDIRS=libselinux libsemanage @@ -19,10 +20,14 @@ else endif ifneq ($(DESTDIR),) - CFLAGS += -I$(DESTDIR)/usr/include - LDFLAGS += -L$(DESTDIR)/usr/lib + LIBDIR ?= $(DESTDIR)$(PREFIX)/lib + LIBSEPOLA ?= $(LIBDIR)/libsepol.a + + CFLAGS += -I$(DESTDIR)$(PREFIX)/include + LDFLAGS += -L$(DESTDIR)$(PREFIX)/lib -L$(LIBDIR) export CFLAGS export LDFLAGS + export LIBSEPOLA endif all install relabel clean test indent: