This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
sonic-buildimage/platform/broadcom/saibcm-modules/make/Make.linux
Guohan Lu aa2e340f5a [broadcom]: build broadcom kernel modules from gpl source codes
Signed-off-by: Guohan Lu <gulv@microsoft.com>
2018-08-11 09:09:03 +00:00

99 lines
2.7 KiB
Plaintext

#
# Unless you and Broadcom execute a separate written software license
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
#
# As a special exception, the copyright holders of this software give
# you permission to link this software with independent modules, and to
# copy and distribute the resulting executable under terms of your
# choice, provided that you also meet, for each linked independent
# module, the terms and conditions of the license of that module. An
# independent module is a module which is not derived from this
# software. The special exception does not apply to any modifications
# of the software.
#
#
# $Id: Make.linux,v 1.18 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
#
# Common make targets for Linux user and kernel builds included by top
# level Linux makefiles
#
# Variables referenced:
#
# LINUX_MAKE_FLAGS
# Additional flags passed to Make
#
# LINUX_MAKE_USER
# Defined: user build
# Undefined: kernel build
#
# LINUX_MAKE_DIR
# Common makefile location, if it is not ../common
#
#
export DEST_DIR_SUFFIX :=$(subst $(realpath $(SDK))/systems,,$(realpath $(CURDIR)/$(dir ($(firstword $(MAKEFILE_LIST))))))
ifeq (,$(kernel_version))
kernel_version=2_4
endif
ifndef LINUX_MAKE_SHARED_LIB
LINUX_MAKE_SHARED_LIB=0
endif
ifeq (,$(SHAREDLIBVER))
SHAREDLIBVER=1
endif
ifndef LINUX_MAKE_DIR
ifdef LINUX_MAKE_USER
LINUX_MAKE_DIR := $(SDK)/systems/linux/user/common
else
LINUX_MAKE_DIR := $(SDK)/systems/linux/kernel/common
endif
endif
ifdef LINUX_MAKE_USER
CMD = $(LINUX_MAKE_FLAGS) -C $(LINUX_MAKE_DIR) \
platform=$(platform) bldroot_suffix=/$(platform) kernel_version=$(kernel_version) \
LINUX_MAKE_SHARED_LIB=$(LINUX_MAKE_SHARED_LIB) SHAREDLIBVER=$(SHAREDLIBVER)
else
export LINUX_MAKE_KERNEL := 1
CMD = $(LINUX_MAKE_FLAGS) -C $(LINUX_MAKE_DIR) \
platform=$(platform) kernel_version=$(kernel_version)
endif
ifneq (,$(MIPS_TOOLS_DIR))
CMD += MIPS_TOOLS_DIR=$(MIPS_TOOLS_DIR)
endif
ifneq (,$(MIPS_CROSS_COMPILE))
CMD += MIPS_CROSS_COMPILE=$(MIPS_CROSS_COMPILE)
endif
ifneq (,$(LINUX_INCLUDE))
CMD += LINUX_INCLUDE=$(LINUX_INCLUDE)
endif
# gmake does not understand $(CMD) to be a submake
# options are to +$(CMD) or $(MAKE) $(CMD)
# trying the latter
build:
$(MAKE) $(CMD)
DELIVER clean C_COMPILER CXX_COMPILER variable mod bcm user:
$(MAKE) $(CMD) $@
clean_d: clean
distclean:
$(MAKE) $(CMD) $@
.PHONY: build clean distclean clean_d DELIVER variable mod bcm user