sonic-buildimage/platform/broadcom/saibcm-modules/make/Makefile.linux-jag-2_6

167 lines
5.2 KiB
Makefile
Raw Normal View History

#
# Copyright 2017 Broadcom
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation (the "GPL").
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
#
# $Id: Makefile.linux-jag-2_6,v 1.20 Broadcom SDK $
# $Copyright: (c) 2007 Broadcom Corp.
# All Rights Reserved.$
# User must select one platform from below.By default WR_LINUX is selected. .
ifeq (,$(BUILD_PLATFORM))
#BUILD_PLATFORM=ELDK
BUILD_PLATFORM=WR_LINUX
endif
# Specify the KERNEL VERSION you want to use for building SDK.
ifeq (ELDK,$(BUILD_PLATFORM))
ifeq (,$(KERN_VER))
KERN_VER=2.6.21.7
endif
endif
# Specify the Windriver Linux version here.For example '2.0' as shown below.
ifeq (WR_LINUX,$(BUILD_PLATFORM))
ifeq (,$(WRS_LINUX_VERSION))
WRS_LINUX_VERSION=2.0
endif
endif
ifeq (WR_LINUX,$(BUILD_PLATFORM))
ifeq (1.4,$(WRS_LINUX_VERSION))
KERNDIR := /projects/ntsw-tools/linux/wrslinux_1.4/broadcom_bcm95836cpci_be/build/linux-2.6.14-small
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips-wrs-linux-gnu-
endif
export WIND_LIC_PROXY = /projects/ntsw-tools/wrs/wrs_linux/GPP_LE_1.4_PPR/setup/x86-linux2/bin
override PATH := /projects/ntsw-tools/wrs/wrs_linux/GPP_LE_1.4_PPR/gnu/3.4.4-wrlinux-1.4/x86-linux2/bin:$(PATH)
endif
ifeq (2.0,$(WRS_LINUX_VERSION))
#CROSS_COMPILE = mips-wrs-linux-gnu-
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips-wrs-linux-gnu-mips_softfp-glibc_std-
endif
KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/jag/glibc_std/build/linux-2.6.21-standard
endif
WRLINUX_BASE=/tools/windriver/linux_ed/2.0_GA/Linux
TOOLCHAIN_BIN_DIR=$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin
WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin
WRLINUX_GNU_PATH=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2/bin
override PATH:=$(KERNDIR)/../../host-cross/bin:$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH)
WRS_SYSROOT_PATH := $(WRLINUX_GNU_PATH)/../lib/gcc/mips-wrs-linux-gnu/4.1.2/include
export TOOLCHAIN_BIN_DIR WIND_LIC_PROXY
endif
ifeq (ELDK,$(BUILD_PLATFORM))
ifeq (2.6.21.7, $(KERN_VER))
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips_4KC-
endif
override PATH := /tools/eldk/4.1/usr/bin:$(PATH)
KERNDIR ?= /projects/ntsw-tools/linux/eldk/jag-ntswics-eldk/linux-2.6.21.7
endif
endif
comma = ,
basetarget = $(basename $(notdir $@))
modname = $(basetarget)
# Extra variables.
EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
name-fix = $(subst $(comma),_,$(subst -,_,$1))
basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
modname_flags = $(if $(filter 1,$(words $(modname))),\
-D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
# Default Linux include directory
ifeq (,$(LINUX_INCLUDE))
LINUX_INCLUDE := $(KERNDIR)/include
endif
CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=1 -DSYS_BE_OTHER=0
ENDIAN = BE_HOST=1
CFGFLAGS += -D$(ENDIAN)
CFGFLAGS += -DBCM_PLATFORM_STRING=\"JAG_BCM4704\"
ARCH = mips
KBUILD_VERBOSE = 1
export ARCH KBUILD_VERBOSE
ifeq (ELDK,$(BUILD_PLATFORM))
KFLAG_INCLD = /tools/eldk/4.1/usr/lib/gcc/mips-linux/4.0.0/include/
endif
ifeq (1.4,$(WRS_LINUX_VERSION))
# From linux/arch/mips/Makefile
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -Wall -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -O2 -fomit-frame-pointer -g -G 0 -mno-abicalls -fno-pic -pipe -march=mips32 -Wa,-mips32 -Wa,--trap -funit-at-a-time -mlong-calls -Wundef -finline-limit=100000 -mabi=32
endif
#-Wdeclaration-after-statement -Wstrict-prototypes
else
ifeq (2.0,$(WRS_LINUX_VERSION))
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -nostdinc -isystem $(WRS_SYSROOT_PATH) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/autoconf.h -I$(KERNDIR)/arch/mips -I$(KERNDIR)/arch/mips -I$(KERNDIR)/arch/mips/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32 -Wa,-mips32 -Wa,--trap -Iinclude/asm-mips/mach-bcm947xx -Iinclude/asm-mips/mach-generic -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -mlong-calls
endif
endif
endif
ifeq (ELDK,$(BUILD_PLATFORM))
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/autoconf.h -I$(KERNDIR)/arch/mips -I$(KERNDIR)/arch/mips -I$(KERNDIR)/arch/mips/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32 -Wa,-mips32 -Wa,--trap -Iinclude/asm-mips/mach-bcm947xx -Iinclude/asm-mips/mach-generic -fomit-frame-pointer -g -Wdeclaration-after-statement -mlong-calls
endif
endif
ifneq ($(targetplat),user)
include ${SDK}/make/Makefile.linux-kernel-2_6
endif
ifneq (,$(findstring TCL,$(FEATURE_LIST)))
LINK_STATIC=0
export LINK_STATIC
endif