Makefile.linux-keystone-2_6 (7058B)
1 # 2 # This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 3 # 4 # Copyright 2007-2019 Broadcom Inc. All rights reserved. 5 6 # User must select one platform from below.By default WR_LINUX is selected. . 7 ifeq (,$(BUILD_PLATFORM)) 8 #BUILD_PLATFORM=ELDK 9 BUILD_PLATFORM=WR_LINUX 10 endif 11 12 # Specify the KERNEL VERSION you want to use for building SDK. 13 ifeq (ELDK,$(BUILD_PLATFORM)) 14 ifeq (,$(KERN_VER)) 15 KERN_VER=2.6.27.18 16 endif 17 endif 18 19 # Specify the Windriver Linux version here.For example '2.0' as shown below. 20 ifeq (WR_LINUX,$(BUILD_PLATFORM)) 21 ifeq (,$(WRS_LINUX_VERSION)) 22 WRS_LINUX_VERSION=2.0 23 endif 24 endif 25 26 #glibc_small and glibc_std have their own cross-compilation tools and and path for these tools are different as implemented below. To enable glibc_small build, line given below should be uncommented. 27 #To enable glibc_small uncomment the following line. 28 #WRL_GLIBC_SMALL=TRUE 29 30 # Default Linux Kernel directory 31 ifeq (2.0,$(WRS_LINUX_VERSION)) 32 ifeq ($(WRL_GLIBC_SMALL),TRUE) 33 34 ifeq (,$(CROSS_COMPILE)) 35 CROSS_COMPILE := mips-wrs-linux-gnu-mips_74k_softfp-glibc_small- 36 endif 37 38 ifeq (,$(KS_HIGHMEM)) 39 KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/key/soc/systems/linux/keystone/glibc_small_be/build/linux-2.6.21-standard 40 else 41 KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/key/key_highmem/glibc_small/build/linux-2.6.21-standard 42 endif 43 else 44 45 ifeq (,$(CROSS_COMPILE)) 46 CROSS_COMPILE := mips-wrs-linux-gnu-mips_74k_softfp-glibc_std- 47 endif 48 ifeq (,$(KS_HIGHMEM)) 49 KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/key/soc/systems/linux/keystone/glibc_std_debug_be/build/linux-2.6.21-standard 50 else 51 KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/key/key_highmem/glibc_std_debug/build/linux-2.6.21-standard 52 endif 53 54 endif 55 56 # After this point glibc_std and glibc_small share these flags 57 WRLINUX_BASE=/tools/windriver/linux_ed/2.0_GA/Linux 58 TOOLCHAIN_EXEC_PREFIX=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2 59 TOOLCHAIN_BIN_DIR=$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin 60 WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin 61 WRLINUX_GNU_PATH=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2/bin 62 override PATH:=$(KERNDIR)/../../host-cross/bin:$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH) 63 export TOOLCHAIN_EXEC_PREFIX TOOLCHAIN_BIN_DIR WIND_LIC_PROXY 64 65 endif 66 67 ifeq (3.0,$(WRS_LINUX_VERSION)) 68 ifeq ($(WRL_GLIBC_SMALL),TRUE) 69 70 ifeq (,$(CROSS_COMPILE)) 71 CROSS_COMPILE := mips-wrs-linux-gnu-mips_74k_softfp-glibc_small- 72 endif 73 74 ifeq (,$(KS_HIGHMEM)) 75 KERNDIR ?=/projects/ntsw-tools/linux/wrslinux_3.0/key/bcm95300x_30x_glibc_small_be/build/linux-broadcom_bcm_530001_3_be-standard-build 76 KERNDIR_STD ?=/projects/ntsw-tools/linux/wrslinux_3.0/key/bcm95300x_30x_glibc_small_be/build/linux 77 else 78 KERNDIR ?=/projects/ntsw-tools/linux/wrslinux_3.0/key/key_highmem/bcm95300x_30x_glibc_small_be/build/linux-broadcom_bcm_530001_3_be-standard-build 79 KERNDIR_STD ?=/projects/ntsw-tools/linux/wrslinux_3.0/key/key_highmem/bcm95300x_30x_glibc_small_be/build/linux 80 endif 81 82 else 83 84 ifeq (,$(CROSS_COMPILE)) 85 CROSS_COMPILE := mips-wrs-linux-gnu-mips_74k_softfp-glibc_std- 86 endif 87 88 ifeq (,$(KS_HIGHMEM)) 89 KERNDIR ?=/projects/ntsw-tools/linux/wrslinux_3.0/key/bcm95300x_30x_glibc_std_be/build/linux-broadcom_bcm_530001_3_be-standard-build 90 KERNDIR_STD ?=/projects/ntsw-tools/linux/wrslinux_3.0/key/bcm95300x_30x_glibc_std_be/build/linux 91 else 92 KERNDIR ?=/projects/ntsw-tools/linux/wrslinux_3.0/key/key_highmem/bcm95300x_30x_glibc_std_be/build/linux-broadcom_bcm_530001_3_be-standard-build 93 KERNDIR_STD ?=/projects/ntsw-tools/linux/wrslinux_3.0/key/key_highmem/bcm95300x_30x_glibc_std_be/build/linux 94 endif 95 96 endif 97 98 export WRL_GLIBC_SMALL 99 100 # After this point glibc_std and glibc_small share these flags 101 102 WRLINUX_BASE ?=/tools/windriver/linux_ed/3.0.3/Linux 103 TOOLCHAIN_EXEC_PREFIX=$(WRLINUX_BASE)/wrlinux-3.0/layers/wrll-toolchain-4.3a-291/mips/toolchain/x86-linux2/ 104 TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_EXEC_PREFIX) 105 WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin 106 WRLINUX_GNU_PATH = $(WRLINUX_BASE)/wrlinux-3.0/layers/wrll-toolchain-4.3a-291/mips/toolchain/x86-linux2/bin 107 override PATH := $(TOOLCHAIN_EXEC_PREFIX):$(KERNDIR_STD)/../../host-cross/bin:$(KERNDIR_STD)/../../host-cross/mips-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH) 108 export TOOLCHAIN_EXEC_PREFIX TOOLCHAIN_BIN_DIR WIND_LIC_PROXY 109 110 LINUX_INCLUDE_STD := $(KERNDIR_STD)/include 111 112 endif 113 114 ifeq (ELDK,$(BUILD_PLATFORM)) 115 ifeq (2.6.27.18, $(KERN_VER)) 116 117 ifeq (,$(CROSS_COMPILE)) 118 CROSS_COMPILE := mips_4KC- 119 endif 120 121 override PATH := /tools/eldk/4.1/usr/bin:$(PATH) 122 ifeq (,$(KS_HIGHMEM)) 123 KERNDIR ?= /projects/ntsw-tools/linux/eldk/key_eldk/linux-2.6.27.18 124 else 125 KERNDIR ?= /projects/ntsw-tools/linux/eldk/key_eldk/key_highmem/linux-2.6.27.18 126 endif 127 endif 128 endif 129 130 # Default Linux include directory 131 ifeq (,$(LINUX_INCLUDE)) 132 LINUX_INCLUDE := $(KERNDIR)/include 133 endif 134 135 CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=1 -DSYS_BE_OTHER=0 136 ENDIAN = BE_HOST=1 137 CFGFLAGS += -D$(ENDIAN) -DKEYSTONE 138 CFGFLAGS += -DBCM_PLATFORM_STRING=\"KEYSTONE\" 139 140 ARCH = mips 141 KBUILD_VERBOSE = 1 142 143 export ARCH KBUILD_VERBOSE 144 145 146 comma = , 147 basetarget = $(basename $(notdir $@)) 148 modname = $(basetarget) 149 150 # Extra variables. 151 EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) 152 153 name-fix = $(subst $(comma),_,$(subst -,_,$1)) 154 basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))" 155 modname_flags = $(if $(filter 1,$(words $(modname))),\ 156 -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") 157 158 159 ifeq (ELDK,$(BUILD_PLATFORM)) 160 KFLAG_INCLD = /tools/eldk/4.1/usr/lib/gcc/mips-linux/4.0.0/include/ 161 endif 162 163 ifeq (2.0,$(WRS_LINUX_VERSION)) 164 KFLAG_INCLD = $(WRLINUX_GNU_PATH)/../lib/gcc/mips-wrs-linux-gnu/4.1.2/include 165 endif 166 167 ifeq (3.0,$(WRS_LINUX_VERSION)) 168 KFLAG_INCLD = $(WRLINUX_GNU_PATH)/../lib/gcc/mips-wrs-linux-gnu/4.3.2/include 169 endif 170 171 172 173 ifeq (,$(KFLAGS)) 174 KFLAGS := -D__KERNEL__ -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/version.h -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=mips32r2 -Wa,-mips32r2 -Wa,--trap -fomit-frame-pointer -g -Wdeclaration-after-statement -Wno-pointer-sign -mlong-calls 175 endif 176 177 178 ifeq (ELDK,$(BUILD_PLATFORM)) 179 KFLAGS += -I$(LINUX_INCLUDE)/asm-mips/mach-bcm5300x 180 endif 181 ifeq (2.0,$(WRS_LINUX_VERSION)) 182 KFLAGS += -fno-stack-protector -Iinclude/asm-mips/mach-bcm947xx -Iinclude/asm-mips/mach-generic 183 endif 184 #Wind river Linux 3.0 needs addtional flags 185 ifeq (3.0,$(WRS_LINUX_VERSION)) 186 KFLAGS += -fno-stack-protector -I$(LINUX_INCLUDE_STD) -I$(KERNDIR_STD)/arch/mips -I$(KERNDIR_STD)/arch/mips/include -I$(LINUX_INCLUDE_STD)/asm-mips/mach-generic -I$(KERNDIR_STD)/include/asm-mips/mach-bcm5300x -I$(KERNDIR_STD)/include/asm-mips -I$(KERNDIR)/include2 187 endif 188 189 ifneq ($(targetplat),user) 190 include ${SDK}/make/Makefile.linux-kernel-2_6 191 endif 192 193