mk: introduce ldflags print target

This is inspired by pkg-config dicussion for SPDK packaging. For now it
used during nvme-cli building to remove greps on current configuration
just to discover proper LDFLAGS.

Change-Id: I18b3e7690dc27b8c418cb897e57e224850fa7435
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/428335
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Pawel Wodkowski 2018-10-05 16:01:40 +02:00 committed by Jim Harris
parent 1c16c6c088
commit 34387cccec
2 changed files with 13 additions and 5 deletions

View File

@ -97,4 +97,16 @@ cc_version: mk/cc.mk
cxx_version: mk/cc.mk
$(Q)echo "SPDK using CXX=$(CXX)"; $(CXX) -v
.libs_only_other:
$(Q)echo -n '$(SYS_LIBS) '
$(Q)if [ "$(CONFIG_SHARED)" = "y" ]; then \
echo -n '-lspdk '; \
fi
.ldflags:
$(Q)echo -n '$(LDFLAGS) '
ldflags: .ldflags .libs_only_other
$(Q)echo ''
include $(SPDK_ROOT_DIR)/mk/spdk.subdirs.mk

View File

@ -33,12 +33,8 @@ ln -sf "$rootdir" "$spdk_nvme_cli/spdk"
bdfs=$(iter_pci_class_code 01 08 02)
bdf=$(echo $bdfs|awk '{ print $1 }')
if [[ -s $rootdir/CONFIG.local ]] && grep 'CONFIG_LOG_BACKTRACE\?=y' $rootdir/CONFIG.local -q; then
nvme_cli_ldflags='LDFLAGS=-lunwind'
fi
cd $spdk_nvme_cli
make clean && make -j$(nproc) $nvme_cli_ldflags
make clean && make -j$(nproc) LDFLAGS="$(make -s -C $spdk_nvme_cli/spdk ldflags)"
sed -i 's/spdk=0/spdk=1/g' spdk.conf
sed -i 's/shm_id=1/shm_id=0/g' spdk.conf
./nvme list