sonic-buildimage/platform/mellanox/sdk-src/sx-kernel/Makefile
Alexander Allen bec35df04a
[Mellanox] Add arm64 architecture support to mellanox platform (#11342)
- Why I did it
Add support for mellanox platform building for target architecture arm64.

- How I did it
Contains the following changes:
1. Change instances of hard-coded amd64 to $(CONFIGURED_ARCH)
2. Add logic to download correct binary for MFT package
3. Add TARGET_BOOTLOADER=grub definition to rules.mk to override default arm64 bootloader

- How to verify it
Build mellanox platform with TARGET_ARCH set as arm64
2022-07-13 16:21:33 +03:00

30 lines
907 B
Makefile

.ONESHELL:
SHELL = /bin/bash
MAIN_TARGET = sx-kernel_1.mlnx.$(MLNX_SDK_DEB_VERSION)_$(CONFIGURED_ARCH).deb
DERIVED_TARGETS = sx-kernel-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_$(CONFIGURED_ARCH).deb
PACKAGE_NAME = sx_kernel
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# get sources
if [ ! -z "$(MLNX_SDK_SOURCE_BASE_URL)" ]; then
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
pushd sx_kernel-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION)
else
pushd Switch-SDK-drivers
git reset --hard
git clean -xfd
fi
# build
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)