Skip to content

Commit

Permalink
mk: add a lib deps file.
Browse files Browse the repository at this point in the history
By adding this file and modifying the way we define a couple of
variables in the makefiles, we can actually avoid having to redefine
the library dependencies on a per file basis.

Change-Id: Ieab4aa1021b0341fc21e3b65677a9ad7f70559c2
Signed-off-by: Seth Howell <[email protected]>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466063
Tested-by: SPDK CI Jenkins <[email protected]>
Reviewed-by: Jim Harris <[email protected]>
Reviewed-by: Ben Walker <[email protected]>
Reviewed-by: Broadcom SPDK FC-NVMe CI <[email protected]>
  • Loading branch information
Seth5141 authored and jimharris committed Aug 23, 2019
1 parent cfc0fbf commit 9d14641
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
4 changes: 1 addition & 3 deletions lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

SPDK_ROOT_DIR := $(abspath $(CURDIR)/..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
include $(SPDK_ROOT_DIR)/mk/spdk.lib_deps.mk

DIRS-y += bdev blob blobfs conf copy event json jsonrpc \
log log_rpc lvol net rpc sock thread trace util nvme vmd nvmf scsi \
Expand All @@ -52,9 +53,6 @@ ifeq ($(abspath $(CONFIG_ENV)),$(SPDK_ROOT_DIR)/lib/$(ENV_NAME))
DIRS-y += $(ENV_NAME)
endif

DEPDIRS-iscsi := scsi
DEPDIRS-bdev := notify

.PHONY: all clean $(DIRS-y)

all: $(DIRS-y)
Expand Down
1 change: 0 additions & 1 deletion lib/iscsi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,5 @@ C_SRCS = conn.c \
iscsi_rpc.c task.c
LIBNAME = iscsi
LOCAL_SYS_LIBS = -lcrypto
SPDK_DEP_LIBNAMES = scsi

include $(SPDK_ROOT_DIR)/mk/spdk.lib.mk
3 changes: 2 additions & 1 deletion mk/spdk.lib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#

include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
include $(SPDK_ROOT_DIR)/mk/spdk.lib_deps.mk

SPDK_MAP_FILE = $(SPDK_ROOT_DIR)/shared_lib/spdk.map
LIB := $(call spdk_lib_list_to_static_libs,$(LIBNAME))
Expand Down Expand Up @@ -63,7 +64,7 @@ else
BUILD_DEP := $(DEP)
endif

SPDK_DEP_LIBS = $(call spdk_lib_list_to_shared_libs,$(SPDK_DEP_LIBNAMES))
SPDK_DEP_LIBS = $(call spdk_lib_list_to_shared_libs,$(DEPDIRS-$(LIBNAME)))

.PHONY: all clean $(DIRS-y)

Expand Down
35 changes: 35 additions & 0 deletions mk/spdk.lib_deps.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# BSD LICENSE
#
# Copyright (c) Intel Corporation.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

DEPDIRS-iscsi := scsi
DEPDIRS-bdev := notify

0 comments on commit 9d14641

Please sign in to comment.