openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

Makefile.linux-keystone_le-2_6 (6429B)


      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=WR_LINUX
      9 endif
     10 
     11 # Specify the Windriver Linux version here.For example '2.0' as shown below.
     12 ifeq (WR_LINUX,$(BUILD_PLATFORM))
     13 ifeq (,$(WRS_LINUX_VERSION))
     14 WRS_LINUX_VERSION=2.0
     15 endif
     16 endif
     17 
     18 #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.
     19 #To enable glibc_small uncomment the following line.
     20 #WRL_GLIBC_SMALL=TRUE
     21 
     22 # Default Linux Kernel directory
     23 ifeq (2.0,$(WRS_LINUX_VERSION))
     24 ifeq ($(WRL_GLIBC_SMALL),TRUE)
     25 
     26 ifeq (,$(CROSS_COMPILE))
     27 CROSS_COMPILE := mips-wrs-linux-gnu-mipsel_74k_softfp-glibc_small-
     28 endif
     29 
     30 ifeq (,$(KS_HIGHMEM))
     31 KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/key/soc/systems/linux/keystone/glibc_small_le/build/linux-2.6.21-standard
     32 else
     33 KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/key/key_highmem/glibc_small_le/build/linux-2.6.21-standard
     34 endif
     35 else
     36 
     37 ifeq (,$(CROSS_COMPILE))
     38 CROSS_COMPILE := mips-wrs-linux-gnu-mipsel_74k_softfp-glibc_std-
     39 endif
     40 
     41 ifeq (,$(KS_HIGHMEM))
     42 KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/key/soc/systems/linux/keystone/glibc_std_debug_le/build/linux-2.6.21-standard
     43 else
     44 KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/key/key_highmem/glibc_std_debug_le/build/linux-2.6.21-standard
     45 endif
     46 
     47 endif
     48 
     49 # After this point glibc_std and glibc_small share these flags
     50 WRLINUX_BASE=/tools/windriver/linux_ed/2.0_GA/Linux
     51 TOOLCHAIN_EXEC_PREFIX=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2
     52 TOOLCHAIN_BIN_DIR=$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin
     53 WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin
     54 WRLINUX_GNU_PATH=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2/bin
     55 override PATH:=$(KERNDIR)/../../host-cross/bin:$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH)
     56 export TOOLCHAIN_EXEC_PREFIX TOOLCHAIN_BIN_DIR WIND_LIC_PROXY
     57 
     58 endif
     59 
     60 ifeq (3.0,$(WRS_LINUX_VERSION))
     61 ifeq ($(WRL_GLIBC_SMALL),TRUE)
     62 
     63 ifeq (,$(CROSS_COMPILE))
     64 CROSS_COMPILE := mips-wrs-linux-gnu-mipsel_74k_softfp-glibc_small-
     65 endif
     66 
     67 ifeq (,$(KS_HIGHMEM))
     68 KERNDIR ?=/projects/ntsw-tools/linux/wrslinux_3.0/key/bcm95300x_30x_glibc_small_le/build/linux-broadcom_bcm_530001_3_be-standard-build
     69 KERNDIR_STD ?=/projects/ntsw-tools/linux/wrslinux_3.0/key/bcm95300x_30_glibc_small_le/build/linux
     70 else
     71 KERNDIR ?= /projects/ntsw-tools/linux/wrslinux_3.0/key/key_highmem/bcm95300x_30x_glibc_small_le/build/linux-broadcom_bcm_530001_3_be-standard-build
     72 KERNDIR_STD ?= /projects/ntsw-tools/linux/wrslinux_3.0/key/key_highmem/bcm95300x_30_glibc_small_le/build/linux
     73 endif
     74 
     75 else
     76 
     77 ifeq (,$(CROSS_COMPILE))
     78 CROSS_COMPILE := mips-wrs-linux-gnu-mipsel_74k_softfp-glibc_std-
     79 endif
     80 
     81 ifeq (,$(KS_HIGHMEM))
     82 KERNDIR ?=/projects/ntsw-tools/linux/wrslinux_3.0/key/bcm95300x_30x_glibc_std_le/build/linux-broadcom_bcm_530001_3_be-standard-build
     83 KERNDIR_STD ?=/projects/ntsw-tools/linux/wrslinux_3.0/key/bcm95300x_30_glibc_std_debug_le/build/linux
     84 else
     85 KERNDIR ?= /projects/ntsw-tools/linux/wrslinux_3.0/key/key_highmem/bcm95300x_30x_glibc_std_le/build/linux-broadcom_bcm_530001_3_be-standard-build
     86 KERNDIR_STD ?= /projects/ntsw-tools/linux/wrslinux_3.0/key/key_highmem/bcm95300x_30_glibc_std_debug_le/build/linux
     87 endif
     88 
     89 endif 
     90 
     91 export WRL_GLIBC_SMALL
     92 
     93 # After this point glibc_std and glibc_small share these flags
     94 
     95 WRLINUX_BASE ?=/tools/windriver/linux_ed/3.0.3/Linux
     96 TOOLCHAIN_EXEC_PREFIX=$(WRLINUX_BASE)/wrlinux-3.0/layers/wrll-toolchain-4.3a-291/mips/toolchain/x86-linux2/
     97 TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_EXEC_PREFIX)
     98 WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin
     99 WRLINUX_GNU_PATH = $(WRLINUX_BASE)/wrlinux-3.0/layers/wrll-toolchain-4.3a-291/mips/toolchain/x86-linux2/bin
    100 override PATH := $(TOOLCHAIN_EXEC_PREFIX):$(KERNDIR_STD)/../../host-cross/bin:$(KERNDIR_STD)/../../host-cross/mips-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH)
    101 export TOOLCHAIN_EXEC_PREFIX TOOLCHAIN_BIN_DIR WIND_LIC_PROXY
    102 
    103 LINUX_INCLUDE_STD := $(KERNDIR_STD)/include
    104 
    105 endif
    106 
    107 
    108 # Default Linux include directory
    109 ifeq (,$(LINUX_INCLUDE))
    110 LINUX_INCLUDE := $(KERNDIR)/include
    111 endif
    112 
    113 CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=0
    114 ENDIAN = LE_HOST=1
    115 CFGFLAGS += -D$(ENDIAN) -DKEYSTONE
    116 CFGFLAGS += -DBCM_PLATFORM_STRING=\"KEYSTONE\"
    117 
    118 ARCH = mips
    119 KBUILD_VERBOSE = 1
    120 
    121 export ARCH KBUILD_VERBOSE
    122 
    123 
    124 comma = ,
    125 basetarget = $(basename $(notdir $@))
    126 modname = $(basetarget)
    127 
    128 # Extra variables.
    129 EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
    130 
    131 name-fix = $(subst $(comma),_,$(subst -,_,$1))
    132 basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
    133 modname_flags  = $(if $(filter 1,$(words $(modname))),\
    134                  -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
    135 
    136 ifeq (2.0,$(WRS_LINUX_VERSION))
    137 KFLAG_INCLD = $(WRLINUX_GNU_PATH)/../lib/gcc/mips-wrs-linux-gnu/4.1.2/include
    138 endif
    139 
    140 ifeq (3.0,$(WRS_LINUX_VERSION))
    141 KFLAG_INCLD = $(WRLINUX_GNU_PATH)/../lib/gcc/mips-wrs-linux-gnu/4.3.2/include
    142 endif
    143 
    144 
    145 
    146 ifeq (,$(KFLAGS))
    147 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 -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -mlong-calls
    148 endif
    149 
    150 
    151 ifeq (ELDK,$(BUILD_PLATFORM))
    152 KFLAGS += -I$(LINUX_INCLUDE)/asm-mips/mach-bcm5300x
    153 endif
    154 ifeq (2.0,$(WRS_LINUX_VERSION))
    155 KFLAGS += -Iinclude/asm-mips/mach-bcm947xx -Iinclude/asm-mips/mach-generic
    156 endif
    157 #Wind river Linux 3.0 needs addtional flags
    158 ifeq (3.0,$(WRS_LINUX_VERSION))
    159 KFLAGS +=  -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
    160 endif
    161 
    162 ifneq ($(targetplat),user)
    163 include ${SDK}/make/Makefile.linux-kernel-2_6
    164 endif
    165 
    166