From af2a731de309ffb21ba4371b8a258274e92637e2 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Mon, 7 Dec 2015 13:57:12 -0700 Subject: [PATCH] build: Allow relative path for DPDK_DIR This is very convenient. It also works from subdirectories, as long as you adjust the relative path you pass appropriately. Change-Id: I8cfeac380ccb5fad4389ee1feb838f986a837f11 Signed-off-by: Ben Walker --- README.md | 4 ++-- mk/spdk.common.mk | 7 ++++--- mk/spdk.subdirs.mk | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f5954f4e7..e7f86b39f 100644 --- a/README.md +++ b/README.md @@ -72,11 +72,11 @@ If you followed the instructions above for building DPDK: Linux: - make DPDK_DIR=`pwd`/dpdk-2.1.0/x86_64-native-linuxapp-gcc + make DPDK_DIR=./dpdk-2.1.0/x86_64-native-linuxapp-gcc FreeBSD: - gmake DPDK_DIR=`pwd`/dpdk-2.1.0/x86_64-native-bsdapp-clang + gmake DPDK_DIR=./dpdk-2.1.0/x86_64-native-bsdapp-clang Hugepages and Device Binding ============================ diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk index 58fade265..ebba07289 100644 --- a/mk/spdk.common.mk +++ b/mk/spdk.common.mk @@ -114,14 +114,15 @@ LIB_C=\ %.d: ; DPDK_DIR ?= $(CONFIG_DPDK_DIR) -DPDK_INC_DIR ?= $(DPDK_DIR)/include -DPDK_LIB_DIR ?= $(DPDK_DIR)/lib +export DPDK_DIR_ABS = $(abspath $(DPDK_DIR)) +DPDK_INC_DIR ?= $(DPDK_DIR_ABS)/include +DPDK_LIB_DIR ?= $(DPDK_DIR_ABS)/lib DPDK_INC = -I$(DPDK_INC_DIR) DPDK_LIB = -L$(DPDK_LIB_DIR) -lrte_eal -lrte_mempool -lrte_ring -Wl,-rpath=$(DPDK_LIB_DIR) # librte_malloc was removed after DPDK 2.1. Link this library conditionally based on its # existence to maintain backward compatibility. -ifneq ($(wildcard $(DPDK_DIR)/lib/librte_malloc.*),) +ifneq ($(wildcard $(DPDK_DIR_ABS)/lib/librte_malloc.*),) DPDK_LIB += -lrte_malloc endif diff --git a/mk/spdk.subdirs.mk b/mk/spdk.subdirs.mk index 173912410..e8064476d 100644 --- a/mk/spdk.subdirs.mk +++ b/mk/spdk.subdirs.mk @@ -1,3 +1,3 @@ $(DIRS-y) : @echo "== $S/$@ ($(MAKECMDGOALS))" - $(Q)$(MAKE) -C $@ S=$S/$@ $(MAKECMDGOALS) $(MAKESUBDIRFLAGS) + $(Q)$(MAKE) -e -C $@ S=$S/$@ $(MAKECMDGOALS) $(MAKESUBDIRFLAGS)