build: setup buildpaths if DESTDIR is specified

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
This commit is contained in:
Marcus Folkesson 2018-02-14 10:57:17 +01:00 committed by Nicolas Iooss
parent a44b3735df
commit a46776cdcf
1 changed files with 7 additions and 2 deletions

View File

@ -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: