-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mellanox] add makefiles to build Mellanox SDK from sources #2701
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4fb0056
[.gitignore] add missing directories to .gitignore
4dd3492
[buildsystem] add ability to override make variables from root Makefile
26a48c5
[mellanox] add SDK build from sources
af5b105
[mellanox] pass -j$(SONIC_CONFIG_MAKE_JOBS) when building SDK
845942c
[mellanox] Add MLNX_SAI_REPO, MLNX_FW_BASE_URL variables
657aa99
[mellanox] if MLNX_SDK_BASE_SOURCE_URL is not empty then build SDK fr…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added SONIC_OVERRIDE_BUILD_VARS to have ability to pass variables to slave makefile, specifically to pass MLNX_SDK_SOURCE_BASE_URL in build time this way, instead of introducing vendor build parameters in root makefile
usage: