[mellanox] add makefiles to build Mellanox SDK from sources (#2701)

* [.gitignore] add missing directories to .gitignore

Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>

* [buildsystem] add ability to override make variables from root Makefile

To override any make variable during build use SONIC_OVERRIDE_BUILD_VARS, e.g:
"make SONIC_OVERRIDE_BUILD_VARS="PARAM1=A PARAM2=B" all"

Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>

* [mellanox] add SDK build from sources

Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>

* [mellanox] pass -j$(SONIC_CONFIG_MAKE_JOBS) when building SDK

Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>

* [mellanox] Add MLNX_SAI_REPO, MLNX_FW_BASE_URL variables

Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>

* [mellanox] if MLNX_SDK_BASE_SOURCE_URL is not empty then build SDK from sources

Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
This commit is contained in:
Stepan Blyshchak 2019-03-28 03:32:25 +02:00 committed by lguohan
parent 9af7d21e2e
commit 0e01ff557b
19 changed files with 365 additions and 29 deletions

22
.gitignore vendored
View File

@ -11,12 +11,31 @@ target/
*.buildinfo *.buildinfo
# Subdirectories in src # Subdirectories in src
src/bash/*
!src/bash/Makefile
src/ixgbe/*
!src/ixgbe/Makefile
src/isc-dhcp/*
!src/isc-dhcp/Makefile
!src/isc-dhcp/patch
src/socat/*
!src/socat/Makefile
!src/socat/*.patch
src/tacacs/*
src/tacacs/nsm/*
src/tacacs/pam/*
!src/tacacs/nsm/Makefile
!src/tacacs/nsm/*.patch
!src/tacacs/pam/Makefile
!src/tacacs/pam/*.patch
src/hiredis/* src/hiredis/*
!src/hiredis/Makefile !src/hiredis/Makefile
src/igb/* src/igb/*
!src/igb/Makefile !src/igb/Makefile
src/initramfs-tools/* src/initramfs-tools/*
!src/initramfs-tools/Makefile !src/initramfs-tools/Makefile
src/iproute2/*
!src/iproute2/Makefile
src/isc-dhcp/* src/isc-dhcp/*
!src/isc-dhcp/Makefile !src/isc-dhcp/Makefile
!src/isc-dhcp/patch/ !src/isc-dhcp/patch/
@ -84,3 +103,6 @@ installer/x86_64/platforms/
src/sonic-config-engine/**/*.pyc src/sonic-config-engine/**/*.pyc
src/sonic-config-engine/build src/sonic-config-engine/build
src/sonic-config-engine/sonic_config_engine.egg-info src/sonic-config-engine/sonic_config_engine.egg-info
src/sonic-daemon-base/**/*.pyc
src/sonic-daemon-base/build
src/sonic-daemon-base/sonic_daemon_base.egg-info

View File

@ -118,7 +118,8 @@ SONIC_BUILD_INSTRUCTION := make \
KERNEL_PROCURE_METHOD=$(KERNEL_PROCURE_METHOD) \ KERNEL_PROCURE_METHOD=$(KERNEL_PROCURE_METHOD) \
HTTP_PROXY=$(http_proxy) \ HTTP_PROXY=$(http_proxy) \
HTTPS_PROXY=$(https_proxy) \ HTTPS_PROXY=$(https_proxy) \
SONIC_ENABLE_SYSTEM_TELEMETRY=$(ENABLE_SYSTEM_TELEMETRY) SONIC_ENABLE_SYSTEM_TELEMETRY=$(ENABLE_SYSTEM_TELEMETRY) \
$(SONIC_OVERRIDE_BUILD_VARS)
.PHONY: sonic-slave-build sonic-slave-bash init reset .PHONY: sonic-slave-build sonic-slave-bash init reset

View File

@ -6,6 +6,16 @@ hw-management/*
!hw-management/*.patch !hw-management/*.patch
mft/* mft/*
!mft/Makefile !mft/Makefile
sdk-src/*/*
!sdk-src/*/Makefile
!sdk-src/*/*.patch
*/build
*/deb_dist
*/dist
*/*.gz
*/*.egg-info
# Autogenerated Dockerfiles # Autogenerated Dockerfiles
docker-syncd-mlnx/Dockerfile docker-syncd-mlnx/Dockerfile
docker-syncd-mlnx-rpc/Dockerfile
docker-saiserver-mlnx/Dockerfile

View File

@ -1,5 +1,7 @@
# mellanox firmware # mellanox firmware
MLNX_FW_BASE_URL = $(MLNX_SDK_BASE_URL)
MLNX_SPC_FW_VERSION = 13.1910.0920 MLNX_SPC_FW_VERSION = 13.1910.0920
MLNX_SPC_FW_FILE = fw-SPC-rel-$(subst .,_,$(MLNX_SPC_FW_VERSION))-EVB.mfa MLNX_SPC_FW_FILE = fw-SPC-rel-$(subst .,_,$(MLNX_SPC_FW_VERSION))-EVB.mfa
$(MLNX_SPC_FW_FILE)_URL = $(MLNX_SDK_BASE_URL)/$(MLNX_SPC_FW_FILE) $(MLNX_SPC_FW_FILE)_URL = $(MLNX_SDK_BASE_URL)/$(MLNX_SPC_FW_FILE)
@ -7,7 +9,7 @@ SONIC_ONLINE_FILES += $(MLNX_SPC_FW_FILE)
MLNX_SPC2_FW_VERSION = 29.1961.0006 MLNX_SPC2_FW_VERSION = 29.1961.0006
MLNX_SPC2_FW_FILE = fw-SPC2-rel-$(subst .,_,$(MLNX_SPC2_FW_VERSION))-EVB.mfa MLNX_SPC2_FW_FILE = fw-SPC2-rel-$(subst .,_,$(MLNX_SPC2_FW_VERSION))-EVB.mfa
$(MLNX_SPC2_FW_FILE)_URL = $(MLNX_SDK_BASE_URL)/$(MLNX_SPC2_FW_FILE) $(MLNX_SPC2_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC2_FW_FILE)
SONIC_ONLINE_FILES += $(MLNX_SPC2_FW_FILE) SONIC_ONLINE_FILES += $(MLNX_SPC2_FW_FILE)
export MLNX_SPC_FW_VERSION export MLNX_SPC_FW_VERSION

View File

@ -1,9 +1,10 @@
# Mellanox SAI # Mellanox SAI
MLNX_SAI_REPO = https://github.com/Mellanox/SAI-Implementation.git
MLNX_SAI_VERSION = SAIRel1.13.7-master MLNX_SAI_VERSION = SAIRel1.13.7-master
MLNX_SAI_REVISION = 52dbd2f5e51cdb538b05f6c2f387b0fccbff9a8e MLNX_SAI_REVISION = 52dbd2f5e51cdb538b05f6c2f387b0fccbff9a8e
export MLNX_SAI_VERSION MLNX_SAI_REVISION export MLNX_SAI_REPO MLNX_SAI_VERSION MLNX_SAI_REVISION
MLNX_SAI = mlnx-sai_1.mlnx.$(MLNX_SAI_VERSION)_amd64.deb MLNX_SAI = mlnx-sai_1.mlnx.$(MLNX_SAI_VERSION)_amd64.deb
$(MLNX_SAI)_SRC_PATH = $(PLATFORM_PATH)/mlnx-sai $(MLNX_SAI)_SRC_PATH = $(PLATFORM_PATH)/mlnx-sai

View File

@ -7,7 +7,7 @@ MAIN_TARGET = mlnx-sai_1.mlnx.$(MLNX_SAI_VERSION)_amd64.deb
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# get sources # get sources
rm -rf SAI-Implementation rm -rf SAI-Implementation
git clone https://github.com/Mellanox/SAI-Implementation.git git clone $(MLNX_SAI_REPO) SAI-Implementation
# build # build
pushd SAI-Implementation pushd SAI-Implementation

View File

@ -0,0 +1,30 @@
.ONESHELL:
SHELL = /bin/bash
MAIN_TARGET = applibs_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
DERIVED_TARGETS = applibs-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
PACKAGE_NAME = applibs
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# get sources
rm -rf $(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
wget -c $(MLNX_SDK_SOURCE_BASE_URL)/$(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION).tar.gz -O - | tar -xz
# build
pushd $(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
sed -i "s/sx-libnl/$(LIBNL3)/g" ./debian/control
sed -i "s/-Werror//g" ./configure.in
if [ -f autogen.sh ]; then
./autogen.sh
fi
debuild -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS)
popd
mv $(DERIVED_TARGETS) $* $(DEST)/
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)

View File

@ -0,0 +1,27 @@
.ONESHELL:
SHELL = /bin/bash
MAIN_TARGET = iproute2_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
DERIVED_TARGETS = iproute2-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
PACKAGE_NAME = iproute2-3.19.0
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# get sources
rm -rf $(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
wget -c $(MLNX_SDK_SOURCE_BASE_URL)/$(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION).tar.gz -O - | tar -xz
# build
pushd $(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
if [ -f autogen.sh ]; then
./autogen.sh
fi
debuild -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS)
popd
mv $(DERIVED_TARGETS) $* $(DEST)/
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)

View File

@ -0,0 +1,27 @@
.ONESHELL:
SHELL = /bin/bash
MAIN_TARGET = python-sdk-api_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
DERIVED_TARGETS =
PACKAGE_NAME = python_sdk_api
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# get sources
rm -rf $(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
wget -c $(MLNX_SDK_SOURCE_BASE_URL)/$(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION).tar.gz -O - | tar -xz
# build
pushd $(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
if [ -f autogen.sh ]; then
./autogen.sh
fi
debuild -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS)
popd
mv $(DERIVED_TARGETS) $* $(DEST)/
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)

View File

@ -0,0 +1,28 @@
.ONESHELL:
SHELL = /bin/bash
MAIN_TARGET = sx-complib_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
DERIVED_TARGETS = sx-complib-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb \
sx-complib-dev-static_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
PACKAGE_NAME = sx_complib
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# get sources
rm -rf $(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
wget -c $(MLNX_SDK_SOURCE_BASE_URL)/$(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION).tar.gz -O - | tar -xz
# build
pushd $(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
if [ -f autogen.sh ]; then
./autogen.sh
fi
debuild -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS)
popd
mv $(DERIVED_TARGETS) $* $(DEST)/
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)

View File

@ -0,0 +1,27 @@
.ONESHELL:
SHELL = /bin/bash
MAIN_TARGET = sx-examples_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
DERIVED_TARGETS = sx-examples-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
PACKAGE_NAME = sx_examples
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# get sources
rm -rf $(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
wget -c $(MLNX_SDK_SOURCE_BASE_URL)/$(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION).tar.gz -O - | tar -xz
# build
pushd $(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
if [ -f autogen.sh ]; then
./autogen.sh
fi
debuild -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS)
popd
mv $(DERIVED_TARGETS) $* $(DEST)/
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)

View File

@ -0,0 +1,27 @@
.ONESHELL:
SHELL = /bin/bash
MAIN_TARGET = sx-gen-utils_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
DERIVED_TARGETS = sx-gen-utils-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
PACKAGE_NAME = sx_gen_utils
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# get sources
rm -rf $(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
wget -c $(MLNX_SDK_SOURCE_BASE_URL)/$(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION).tar.gz -O - | tar -xz
# build
pushd $(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
if [ -f autogen.sh ]; then
./autogen.sh
fi
debuild -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS)
popd
mv $(DERIVED_TARGETS) $* $(DEST)/
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)

View File

@ -0,0 +1,24 @@
.ONESHELL:
SHELL = /bin/bash
MAIN_TARGET = sx-kernel_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
DERIVED_TARGETS = sx-kernel-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
PACKAGE_NAME = sx_kernel
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# get sources
rm -rf sx_kernel-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
wget -c $(MLNX_SDK_SOURCE_BASE_URL)/$(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION).tar.gz -O - | tar -xz
# build
pushd sx_kernel-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
patch -p1 < ../sx_kernel_makefile_sonic_build.patch
debuild -e KVERSION=$(KVERSION) -e KSRC_EXT=/lib/modules/$(KVERSION)/source/ -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS)
popd
mv $(DERIVED_TARGETS) $* $(DEST)/
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)

View File

@ -0,0 +1,18 @@
diff --git a/makefile b/makefile
index f23f0ac..a16b2ce 100644
--- a/makefile
+++ b/makefile
@@ -93,10 +93,10 @@ V ?= 1
ifneq ($(findstring 3.10,$(KVERSION))$(findstring 3.13,$(KVERSION))$(findstring 3.14,$(KVERSION))$(findstring 3.16,$(KVERSION)),)
MLNX_LINUX_AUTOCONF_FILE = include/generated/autoconf.h
-MLNX_LINUX_EXTRA_INCLUDE_FILES = -include include/linux/kconfig.h
+MLNX_LINUX_EXTRA_INCLUDE_FILES = -include $(KSRC_EXT)/include/linux/kconfig.h
MLNX_LINUX_EXTRA_INCLUDE_FOLDERS = \
- -Iarch/$$(SRCARCH)/include/uapi \
- -Iinclude/uapi \
+ -I$(KSRC_EXT)/arch/$$(SRCARCH)/include/uapi \
+ -I$(KSRC_EXT)/include/uapi \
-Iarch/$$(SRCARCH)/include/generated/uapi \
-Iarch/$$(SRCARCH)/include/generated \
-Iinclude/generated/uapi

View File

@ -0,0 +1,28 @@
.ONESHELL:
SHELL = /bin/bash
MAIN_TARGET = sx-scew_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
DERIVED_TARGETS = sx-scew-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb \
sx-scew-dev-static_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
PACKAGE_NAME = sx_scew
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# get sources
rm -rf $(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
wget -c $(MLNX_SDK_SOURCE_BASE_URL)/$(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION).tar.gz -O - | tar -xz
# build
pushd $(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
if [ -f autogen.sh ]; then
./autogen.sh
fi
debuild -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS)
popd
mv $(DERIVED_TARGETS) $* $(DEST)/
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)

View File

@ -0,0 +1,28 @@
.ONESHELL:
SHELL = /bin/bash
MAIN_TARGET = sxd-libs_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
DERIVED_TARGETS = sxd-libs-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb \
sxd-libs-dev-static_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
PACKAGE_NAME = sxd_libs
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# get sources
rm -rf $(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
wget -c $(MLNX_SDK_SOURCE_BASE_URL)/$(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION).tar.gz -O - | tar -xz
# build
pushd $(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
if [ -f autogen.sh ]; then
./autogen.sh
fi
debuild -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS)
popd
mv $(DERIVED_TARGETS) $* $(DEST)/
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)

View File

@ -1,49 +1,74 @@
MLNX_SDK_BASE_URL = https://github.com/Mellanox/SAI-Implementation/raw/3c8bb2e4f1292484bdf097ae90ec0a2ef9b41b2b/sdk MLNX_SDK_BASE_URL = https://github.com/Mellanox/SAI-Implementation/raw/3c8bb2e4f1292484bdf097ae90ec0a2ef9b41b2b/sdk
MLNX_SDK_VERSION = 4.3.0136 MLNX_SDK_VERSION = 4.3.0136
MLNX_SDK_ISSU_VERSION = 100
MLNX_SDK_DEB_VERSION = $(subst _,.,$(MLNX_SDK_VERSION))
# Place here URL where SDK sources exist
MLNX_SDK_SOURCE_BASE_URL =
export MLNX_SDK_SOURCE_BASE_URL MLNX_SDK_VERSION MLNX_SDK_ISSU_VERSION MLNX_SDK_DEB_VERSION
MLNX_SDK_RDEBS += $(APPLIBS) $(IPROUTE2_MLNX) $(SX_ACL_RM) $(SX_COMPLIB) \ MLNX_SDK_RDEBS += $(APPLIBS) $(IPROUTE2_MLNX) $(SX_ACL_RM) $(SX_COMPLIB) \
$(SX_EXAMPLES) $(SX_GEN_UTILS) $(SX_SCEW) $(SX_SDN_HAL) \ $(SX_EXAMPLES) $(SX_GEN_UTILS) $(SX_SCEW) $(SXD_LIBS)
$(SXD_LIBS) $(TESTX)
MLNX_SDK_DEBS += $(APPLIBS_DEV) $(IPROUTE2_MLNX_DEV) $(SX_ACL_RM_DEV) \ MLNX_SDK_DEBS += $(APPLIBS_DEV) $(IPROUTE2_MLNX_DEV) $(SX_ACL_RM_DEV) \
$(SX_COMPLIB_DEV) $(SX_COMPLIB_DEV_STATIC) $(SX_EXAMPLES_DEV) \ $(SX_COMPLIB_DEV) $(SX_COMPLIB_DEV_STATIC) $(SX_EXAMPLES_DEV) \
$(SX_GEN_UTILS_DEV) $(SX_SCEW_DEV) $(SX_SCEW_DEV_STATIC) \ $(SX_GEN_UTILS_DEV) $(SX_SCEW_DEV) $(SX_SCEW_DEV_STATIC) \
$(SX_SDN_HAL_DEV) $(SX_SDN_HAL_DEV_STATIC) $(SXD_LIBS_DEV) \ $(SXD_LIBS_DEV) $(SXD_LIBS_DEV_STATIC)
$(SXD_LIBS_DEV_STATIC) $(TESTX_DEV)
APPLIBS = applibs_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb APPLIBS = applibs_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
$(APPLIBS)_DEPENDS += $(SX_COMPLIB) $(SX_GEN_UTILS) $(SXD_LIBS) $(LIBNL3) $(LIBNL_GENL3) $(APPLIBS)_SRC_PATH = $(PLATFORM_PATH)/sdk-src/applibs
$(APPLIBS)_DEPENDS += $(SX_COMPLIB_DEV) $(SX_GEN_UTILS_DEV) $(SXD_LIBS_DEV) $(LIBNL3_DEV) $(LIBNL_GENL3_DEV)
$(APPLIBS)_RDEPENDS += $(SX_COMPLIB) $(SX_GEN_UTILS) $(SXD_LIBS) $(LIBNL3) $(LIBNL_GENL3) $(APPLIBS)_RDEPENDS += $(SX_COMPLIB) $(SX_GEN_UTILS) $(SXD_LIBS) $(LIBNL3) $(LIBNL_GENL3)
APPLIBS_DEV = applibs-dev_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb APPLIBS_DEV = applibs-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
$(eval $(call add_derived_package,$(APPLIBS),$(APPLIBS_DEV))) $(eval $(call add_derived_package,$(APPLIBS),$(APPLIBS_DEV)))
IPROUTE2_MLNX = iproute2_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb
IPROUTE2_MLNX_DEV = iproute2-dev_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb IPROUTE2_MLNX = iproute2_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
$(IPROUTE2_MLNX)_SRC_PATH = $(PLATFORM_PATH)/sdk-src/iproute2
IPROUTE2_MLNX_DEV = iproute2-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
$(eval $(call add_derived_package,$(IPROUTE2_MLNX),$(IPROUTE2_MLNX_DEV))) $(eval $(call add_derived_package,$(IPROUTE2_MLNX),$(IPROUTE2_MLNX_DEV)))
SX_COMPLIB = sx-complib_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb
SX_COMPLIB_DEV = sx-complib-dev_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb SX_COMPLIB = sx-complib_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
$(SX_COMPLIB)_SRC_PATH = $(PLATFORM_PATH)/sdk-src/sx-complib
SX_COMPLIB_DEV = sx-complib-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
$(eval $(call add_derived_package,$(SX_COMPLIB),$(SX_COMPLIB_DEV))) $(eval $(call add_derived_package,$(SX_COMPLIB),$(SX_COMPLIB_DEV)))
SX_EXAMPLES = sx-examples_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb
$(SX_EXAMPLES)_DEPENDS += $(APPLIBS) $(SX_SCEW) $(SXD_LIBS) SX_EXAMPLES = sx-examples_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
$(SX_EXAMPLES)_SRC_PATH = $(PLATFORM_PATH)/sdk-src/sx-examples
$(SX_EXAMPLES)_DEPENDS += $(APPLIBS_DEV) $(SX_SCEW_DEV) $(SXD_LIBS_DEV)
$(SX_EXAMPLES)_RDEPENDS += $(APPLIBS) $(SX_SCEW) $(SXD_LIBS) $(SX_EXAMPLES)_RDEPENDS += $(APPLIBS) $(SX_SCEW) $(SXD_LIBS)
SX_EXAMPLES_DEV = sx-examples-dev_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb SX_EXAMPLES_DEV = sx-examples-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
$(eval $(call add_derived_package,$(SX_EXAMPLES),$(SX_EXAMPLES_DEV))) $(eval $(call add_derived_package,$(SX_EXAMPLES),$(SX_EXAMPLES_DEV)))
SX_GEN_UTILS = sx-gen-utils_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb
$(SX_GEN_UTILS)_DEPENDS += $(SX_COMPLIB) SX_GEN_UTILS = sx-gen-utils_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
$(SX_GEN_UTILS)_SRC_PATH += $(PLATFORM_PATH)/sdk-src/sx-gen-utils
$(SX_GEN_UTILS)_DEPENDS += $(SX_COMPLIB_DEV) $(SXD_LIBS_DEV)
$(SX_GEN_UTILS)_RDEPENDS += $(SX_COMPLIB) $(SX_GEN_UTILS)_RDEPENDS += $(SX_COMPLIB)
SX_GEN_UTILS_DEV = sx-gen-utils-dev_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb SX_GEN_UTILS_DEV = sx-gen-utils-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
$(eval $(call add_derived_package,$(SX_GEN_UTILS),$(SX_GEN_UTILS_DEV))) $(eval $(call add_derived_package,$(SX_GEN_UTILS),$(SX_GEN_UTILS_DEV)))
SX_SCEW = sx-scew_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb
SX_SCEW_DEV = sx-scew-dev_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb SX_SCEW = sx-scew_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
$(SX_SCEW)_SRC_PATH = $(PLATFORM_PATH)/sdk-src/sx-scew
SX_SCEW_DEV = sx-scew-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
$(eval $(call add_derived_package,$(SX_SCEW),$(SX_SCEW_DEV))) $(eval $(call add_derived_package,$(SX_SCEW),$(SX_SCEW_DEV)))
SXD_LIBS = sxd-libs_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb
SXD_LIBS_DEV = sxd-libs-dev_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb SXD_LIBS = sxd-libs_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
$(SXD_LIBS)_SRC_PATH = $(PLATFORM_PATH)/sdk-src/sxd-libs
$(SXD_LIBS)_DEPENDS += $(SX_COMPLIB_DEV)
SXD_LIBS_DEV = sxd-libs-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
$(eval $(call add_derived_package,$(SXD_LIBS),$(SXD_LIBS_DEV))) $(eval $(call add_derived_package,$(SXD_LIBS),$(SXD_LIBS_DEV)))
#packages that are required for runtime only #packages that are required for runtime only
PYTHON_SDK_API = python-sdk-api_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb PYTHON_SDK_API = python-sdk-api_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
$(PYTHON_SDK_API)_DEPENDS += $(APPLIBS) $(SXD_LIBS) $(PYTHON_SDK_API)_SRC_PATH = $(PLATFORM_PATH)/sdk-src/python-sdk-api
$(PYTHON_SDK_API)_DEPENDS += $(APPLIBS_DEV) $(SXD_LIBS_DEV)
$(PYTHON_SDK_API)_RDEPENDS += $(APPLIBS) $(SXD_LIBS) $(PYTHON_SDK_API)_RDEPENDS += $(APPLIBS) $(SXD_LIBS)
SX_KERNEL = sx-kernel_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb
SX_KERNEL_DEV = sx-kernel-dev_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb SX_KERNEL = sx-kernel_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
$(SX_KERNEL)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
$(SX_KERNEL)_SRC_PATH = $(PLATFORM_PATH)/sdk-src/sx-kernel
SX_KERNEL_DEV = sx-kernel-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb
$(eval $(call add_derived_package,$(SX_KERNEL),$(SX_KERNEL_DEV))) $(eval $(call add_derived_package,$(SX_KERNEL),$(SX_KERNEL_DEV)))
define make_url define make_url
@ -55,5 +80,14 @@ $(eval $(foreach deb,$(MLNX_SDK_DEBS),$(call make_url,$(deb))))
$(eval $(foreach deb,$(MLNX_SDK_RDEBS),$(call make_url,$(deb)))) $(eval $(foreach deb,$(MLNX_SDK_RDEBS),$(call make_url,$(deb))))
$(eval $(foreach deb,$(PYTHON_SDK_API) $(SX_KERNEL) $(SX_KERNEL_DEV),$(call make_url,$(deb)))) $(eval $(foreach deb,$(PYTHON_SDK_API) $(SX_KERNEL) $(SX_KERNEL_DEV),$(call make_url,$(deb))))
ifneq ($(MLNX_SDK_SOURCE_BASE_URL), )
SONIC_MAKE_DEBS += $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) $(SX_KERNEL)
else
SONIC_ONLINE_DEBS += $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) $(SX_KERNEL) SONIC_ONLINE_DEBS += $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) $(SX_KERNEL)
endif
SONIC_STRETCH_DEBS += $(SX_KERNEL) SONIC_STRETCH_DEBS += $(SX_KERNEL)
mlnx-sdk-packages: $(addprefix $(DEBS_PATH)/, $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) $(SX_KERNEL))
SONIC_PHONY_TARGETS += mlnx-sdk-packages

View File

@ -110,6 +110,7 @@ RUN apt-get update && apt-get install -y \
libdb-dev \ libdb-dev \
iptables-dev \ iptables-dev \
swig \ swig \
ctags \
# For mellanox sai build # For mellanox sai build
libtool-bin \ libtool-bin \
libxml2-dev \ libxml2-dev \

View File

@ -115,6 +115,7 @@ RUN apt-get update && apt-get install -y \
libdb-dev \ libdb-dev \
iptables-dev \ iptables-dev \
swig \ swig \
ctags \
# For mellanox sai build # For mellanox sai build
libtool-bin \ libtool-bin \
libxml2-dev \ libxml2-dev \