diff mbox

[6/7] Add includes for DESTDIR only in root Makefile

Message ID 20170424175959.20998-6-jason@perfinion.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Jason Zaman April 24, 2017, 5:59 p.m. UTC
Signed-off-by: Jason Zaman <jason@perfinion.com>
---
 Makefile | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 8df4ce3..7701e16 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,13 @@  ifeq ($(DEBUG),1)
 	export LDFLAGS = -g
 endif
 
+ifneq ($(DESTDIR),)
+	CFLAGS += -I$(DESTDIR)/usr/include
+	LDFLAGS += -L$(DESTDIR)/usr/lib
+	export CFLAGS
+	export LDFLAGS
+endif
+
 all install relabel clean test indent:
 	@for subdir in $(SUBDIRS); do \
 		(cd $$subdir && $(MAKE) $@) || exit 1; \