Commit 068b20ab authored by Jim Harris's avatar Jim Harris Committed by Gerrit Code Review
Browse files

build: add OS to spdk.common.mk



This will add different flags, src files, etc. for FreeBSD.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I4f2d664cf42d01745318f241ce9558dccf148b7d
parent 325b7db3
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -41,8 +41,15 @@ ifeq ($(MAKECMDGOALS),)
MAKECMDGOALS=$(.DEFAULT_GOAL)
endif

OS := $(shell uname)

COMMON_CFLAGS = -g $(C_OPT) -Wall -Werror -fno-strict-aliasing -march=native -m64 -I$(SPDK_ROOT_DIR)/include

ifeq ($(OS),FreeBSD)
LIBS += -L/usr/local/lib
COMMON_CFLAGS += -I/usr/local/include
endif

ifeq ($(CONFIG_DEBUG), y)
COMMON_CFLAGS += -DDEBUG -O0
else
@@ -72,6 +79,11 @@ DPDK_INC_DIR ?= $(DPDK_DIR)/include
DPDK_LIB_DIR ?= $(DPDK_DIR)/lib

DPDK_INC = -I$(DPDK_INC_DIR)
# DPDK requires dl library for dlopen/dlclose.
DPDK_LIB = -L$(DPDK_LIB_DIR) -lrte_eal -lrte_malloc -lrte_mempool -lrte_ring -ldl -Wl,-rpath=$(DPDK_LIB_DIR)
DPDK_LIB = -L$(DPDK_LIB_DIR) -lrte_eal -lrte_malloc -lrte_mempool -lrte_ring -Wl,-rpath=$(DPDK_LIB_DIR)
# DPDK requires dl library for dlopen/dlclose on Linux.
ifeq ($(OS),Linux)
DPDK_LIB += -ldl
endif
ifeq ($(OS),FreeBSD)
DPDK_LIB += -lexecinfo
endif