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-bmw-2_6 (3421B)


      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 # Look for custom tools
      7 ifneq (,$(PPC_TOOLS_DIR))
      8 ifneq (,$(PPC_CROSS_COMPILE))
      9 override PATH := $(PPC_TOOLS_DIR):$(PATH)
     10 override CROSS_COMPILE := $(PPC_CROSS_COMPILE)
     11 endif
     12 endif
     13 
     14 # Default tools
     15 ifeq (,$(WRS_LINUX_VERSION))
     16 WRS_LINUX_VERSION=2.0
     17 endif
     18 
     19 # Default Linux Kernel directory
     20 ifeq (,$(KERNDIR))
     21 
     22 ifeq (1.4,$(WRS_LINUX_VERSION))
     23 
     24 KERNDIR := /projects/ntsw-tools/linux/wrslinux_1.4/bcm98245cpci/build/linux-2.6.14-cgl
     25 
     26 ifeq (,$(CROSS_COMPILE))
     27 CROSS_COMPILE = powerpc-wrs-linux-gnu-603e-glibc_std-
     28 endif
     29 
     30 WRLINUX_BASE=/tools/windriver/linux_ed/1.4/Linux
     31 export WIND_LIC_PROXY = $(WRLINUX_BASE)/setup/x86-linux2/bin
     32 override PATH := $(WRLINUX_BASE)/gnu/3.4.4-wrlinux-1.4/x86-linux2/bin:$(PATH)
     33 
     34 WRS_SYSROOT_PATH := $(WRLINUX_GNU_PATH)/../lib/gcc/powerpc-wrs-linux-gnu/3.4.4/include
     35 else
     36 
     37 ifeq (2.0,$(WRS_LINUX_VERSION))
     38 
     39 ifeq (,$(CROSS_COMPILE))
     40 CROSS_COMPILE = powerpc-wrs-linux-gnu-ppc_603e-glibc_std-
     41 endif
     42 
     43 KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/bmw/glibc_std/build/linux-2.6.21-standard
     44 
     45 WRLINUX_BASE=/tools/windriver/linux_ed/2.0_GA/Linux
     46 
     47 TOOLCHAIN_EXEC_PREFIX=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2
     48 TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_EXEC_PREFIX)
     49 WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin
     50 
     51 WRLINUX_GNU_PATH = $(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2/bin
     52 
     53 override PATH := $(TOOLCHAIN_EXEC_PREFIX):$(KERNDIR)/../../host-cross/bin:$(KERNDIR)/../../host-cross/powerpc-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH)
     54 
     55 export TOOLCHAIN_EXEC_PREFIX TOOLCHAIN_BIN_DIR WIND_LIC_PROXY
     56 
     57 WRS_SYSROOT_PATH := $(WRLINUX_GNU_PATH)/../lib/gcc/powerpc-wrs-linux-gnu/4.1.2/include
     58 
     59 comma = ,
     60 basetarget = $(basename $(notdir $@))
     61 modname = $(basetarget)
     62 
     63 # Extra variables.
     64 EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
     65 
     66 name-fix = $(subst $(comma),_,$(subst -,_,$1))
     67 basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
     68 modname_flags  = $(if $(filter 1,$(words $(modname))),\
     69                  -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
     70 endif
     71 endif
     72 endif
     73 
     74 # Default Linux include directory
     75 ifeq (,$(LINUX_INCLUDE))
     76 LINUX_INCLUDE := $(KERNDIR)/include
     77 endif
     78 
     79 CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1
     80 ENDIAN = BE_HOST=1
     81 CFGFLAGS += -D$(ENDIAN)
     82 CFGFLAGS += -DBCM_PLATFORM_STRING=\"BMW_MPC8245/PPC603e\"
     83 
     84 ARCH = ppc
     85 KBUILD_VERBOSE = 1
     86 
     87 export ARCH KBUILD_VERBOSE
     88 
     89 ifeq (1.4,$(WRS_LINUX_VERSION))
     90 # From linux/arch/ppc/Makefile
     91 
     92 ifeq (,$(KFLAGS))
     93 KFLAGS := -D__KERNEL__ -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -fsigned-char -msoft-float -pipe -ffixed-r2 -Wno-uninitialized -mmultiple -mstring
     94 endif
     95 
     96 else
     97 ifeq (2.0,$(WRS_LINUX_VERSION))
     98 
     99 ifeq (,$(KFLAGS))
    100 KFLAGS := -D__KERNEL__ -m32 -nostdinc -isystem $(WRS_SYSROOT_PATH) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/autoconf.h -I$(KERNDIR)/arch/ppc -I$(KERNDIR)/arch/ppc/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -msoft-float -pipe -ffixed-r2 -mmultiple -mno-altivec -mstring -fomit-frame-pointer -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign
    101 endif
    102 
    103 endif
    104 endif
    105 
    106 ifneq ($(targetplat),user)
    107 include ${SDK}/make/Makefile.linux-kernel-2_6
    108 endif