blob: 5e0dfd68b2243cc5d3acf87f1d7f967f0335664f [file] [log] [blame]
Shad Ansari2f7f9be2017-06-07 13:34:53 -07001# Switch SDK for KT2
2#
3
4ifneq ("$(TEST_SW_UTIL_LOOPBACK)", "y")
5
6MOD_NAME = switch_sdk
7MOD_TYPE = lib
8
9MOD_INC_DIRS = $(ING_SDK_DIR)/include
10MOD_INC_DIRS += $(ING_SDK_DIR)/libs/phymod/include
11MOD_LIBS_NOREC_BEFORE = $(shell cat ${ING_SDK_DIR}/.bcm_objs)
12MOD_LIBS = $(shell cat ${ING_SDK_DIR}/.bcm_libs)
13MOD_LIBS_NOREC_AFTER = $(shell cat ${ING_SDK_DIR}/.bcm_ldflags | sed -e 's/-static //') -lutil
14
15# Building with libnetconf requires special care because libxml in bcm_sdk conflicts
16# with newer libxml2
17ifeq ("$(NC_AGENT)", "libnetconf")
18 MOD_LIBS := $(subst -lxml,,$(MOD_LIBS))
19
20 # This is tricky again. SDK build can include multiple versions of xml_api.o
21 # built for different architectures. We need to pick the right one.
22 _all_xml_api := $(shell find $(ING_SDK_DIR) -name xml_api.o)
23 _arch := $(shell file $(firstword $(MOD_LIBS_NOREC_BEFORE)) | awk '{print $$7}')
24 _xml_api := $(shell for aa in $(_all_xml_api); do _test_arch=`file $$aa | awk '{print $$7}'`; if [[ \"$(_arch)\" = \"$$_test_arch\" ]]; then echo $$aa; fi; done)
25
26 MOD_LIBS_NOREC_AFTER += $(_xml_api)
27endif
28
29# end of ifneq ("$(TEST_SW_UTIL_LOOPBACK)", "y")
30endif