-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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>
- Loading branch information
1 parent
9af7d21
commit 0e01ff5
Showing
19 changed files
with
365 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
18 changes: 18 additions & 0 deletions
18
platform/mellanox/sdk-src/sx-kernel/sx_kernel_makefile_sonic_build.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
Oops, something went wrong.