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 <benjamin.walker@intel.com>
This commit is contained in:
Ben Walker 2015-12-07 13:57:12 -07:00
parent ed616a7902
commit af2a731de3
3 changed files with 7 additions and 6 deletions

View File

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

View File

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

View File

@ -1,3 +1,3 @@
$(DIRS-y) :
@echo "== $S/$@ ($(MAKECMDGOALS))"
$(Q)$(MAKE) -C $@ S=$S/$@ $(MAKECMDGOALS) $(MAKESUBDIRFLAGS)
$(Q)$(MAKE) -e -C $@ S=$S/$@ $(MAKECMDGOALS) $(MAKESUBDIRFLAGS)