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-xlr-3_14 (6289B)


      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 #
      7 # XLR system make file.
      8 #
      9 # Most of this was taken from target x86-smp_generic_64-2_6.
     10 #
     11 
     12 
     13 #############################################################################
     14 # this segment is custom and not sourced from any existing makefile         #
     15 # (base thanks to http:<slash><slash>confluence.broadcom.com/display/NTSWSW/X86+System) #
     16 #############################################################################
     17 
     18 # set up a basic feature list. tcl, etc. #
     19 #ifeq (,$(FEATURE_LIST))
     20 #FEATURE_LIST = TCL BFD PTP CINT L3 I2C BCMX BCMX_DIAG MEM_SCAN EDITLINE BCM_SAL_PROFILE CUSTOMER TEST CHASSIS MSTP RCPU
     21 #endif
     22 
     23 # some basic path variables for tools and kernel source, etc #
     24 export XLR_TOOLS_BASE = /projects/ntsw-tools
     25 TOOLCHAIN_DIR = $(XLR_TOOLS_BASE)/toolchains/x86_64/fedora-21
     26 KERNDIR       = $(XLR_TOOLS_BASE)/linux/fedora-21-x86_64/linux-3.14.0-1.nfsv2.fc21.x86_64
     27 
     28 # set up cross compile prefix, tools dir variables. #
     29 export CROSS_COMPILE := x86_64-fedora-linux-gnu-
     30 export TOOLS_DIR     := $(TOOLCHAIN_DIR)/bin
     31 
     32 # architecture. #
     33 ARCH                = x86_64
     34 TARGET_ARCHITECTURE = x86_64-fedora-linux-gnu
     35 
     36 # set up paths. #
     37 export LIBRARY_PATH := $(TOOLCHAIN_DIR)/lib:$(TOOLCHAIN_DIR)/lib64:$(LIBRARY_PATH)
     38 export PATH         := $(TOOLCHAIN_DIR)/bin:$(KERNDIR):$(PATH)
     39 
     40 # set up SYSINC path #
     41 export SYSINC := $(TOOLCHAIN_DIR)/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/include
     42 
     43 # CFLAGS/CFGFLAGS #
     44 CFGFLAGS += -DBCM_WARM_BOOT_SUPPORT
     45 CFGFLAGS += -DBCM_WARM_BOOT_SUPPORT_SW_DUMP
     46 #CFGFLAGS += -DALPM_ENABLE
     47 CFGFLAGS += -DBCM_BPROF_STATS
     48 CFLAGS += -DUSE_LINUX_BDE_MMAP=1
     49 #CFLAGS += -DBDE_LINUX_USE_MSI_INTERRUPT
     50 CFLAGS += -Wno-error=unused-value
     51 CFLAGS += -Wno-error=unused-but-set-variable
     52 CFLAGS += -Wno-error=maybe-uninitialized
     53 CFLAGS += -Wno-error=cpp
     54 CFLAGS += -Wno-error=aggressive-loop-optimizations
     55 CFLAGS += -Wno-error=array-bounds
     56 CFLAGS += -L$(TOOLCHAIN_DIR)/lib
     57 CFLAGS += -L$(TOOLCHAIN_DIR)/lib64
     58 #CFLAGS += -Wl,--rpath=/lib64                                 # may need to set rpath and dynamic-linker path here (and possibly in KLFAGS below) in the future, #
     59 #CFLAGS += -Wl,--dynamic-linker=/lib64/ld-linux-x86-64.so.2   # if we want to build the target executable to be used with shared libs #
     60 
     61 # set up KFLAGS appropriately. #
     62 ifeq (,$(KFLAGS))
     63 KFLAGS := -L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib64 -I$(KERNDIR) -lc -nostdinc -isystem $(SYSINC) -Iinclude -I$(KERNDIR)/arch/x86/include -I$(KERNDIR)/include -I$(KERNDIR)/include/generated -I$(KERNDIR)/arch/x86/include/generated -I$(KERNDIR)/usr/include -I$(KERNDIR)/arch/x86/include/uapi -I$(KERNDIR)/include/uapi -include $(KERNDIR)/include/generated/autoconf.h -D__KERNEL__ -DNDEBUG -Wundef -Wno-error=unused-value -Wno-error=maybe-uninitialized -Wno-error=cpp -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -fstack-protector -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -Wframe-larger-than=1024 -fno-omit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-dwarf2-cfi-asm -fconserve-stack
     64 endif
     65 
     66 
     67 ######################################################################
     68 # this segment comes from make/Makefile.linux-x86-smp_generic_64-2_6 #
     69 ######################################################################
     70 CFGFLAGS += -DLONGS_ARE_64BITS
     71 CFGFLAGS += -DPTRS_ARE_64BITS
     72 CFGFLAGS += -DSAL_SPL_LOCK_ON_IRQ
     73 
     74 
     75 ###########################################################################################
     76 # This segment comes from make/Makefile.linux-x86-generic-common-2_6 (with modifications) #
     77 ###########################################################################################
     78 
     79 # Default kernel source directory
     80 ifeq (,$(KERNDIR))
     81 KERNDIR := /lib/modules/$(shell uname -r)/build
     82 export KERNDIR
     83 endif
     84 
     85 # Default architecture
     86 ifeq (,$(ARCH))
     87 ARCH = x86_64
     88 endif
     89 
     90 # Noisy kernel build
     91 KBUILD_VERBOSE = 1
     92 
     93 export ARCH KBUILD_VERBOSE KERNDIR
     94 
     95 # Default Linux include directory
     96 ifeq (,$(LINUX_INCLUDE))
     97 LINUX_INCLUDE := $(KERNDIR)/include
     98 endif
     99 
    100 # autoconf.h was moved in later kernels
    101 AUTOCONF = $(KERNDIR)/include/generated/autoconf.h
    102 ifeq (,$(shell ls $(AUTOCONF) 2>/dev/null))
    103 AUTOCONF = $(KERNDIR)/include/linux/autoconf.h
    104 endif
    105 
    106 # gcc system include path
    107 #SYSINC = $(shell gcc -print-search-dirs | grep install | cut -c 10-)include
    108 
    109 
    110 ifeq (,$(KFLAGS))
    111 KFLAGS := -nostdinc -isystem $(SYSINC) -I$(KERNDIR)/include -I$(KERNDIR)/arch/x86/include -include $(AUTOCONF) -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-stack-protector -fomit-frame-pointer -g -Wdeclaration-after-statement -Wno-pointer-sign
    112 endif
    113 
    114 
    115 
    116 ##############################################################
    117 # This segment comes from make/Makefile.linux-x86-common-2_6 #
    118 ##############################################################
    119 CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=0
    120 ENDIAN = LE_HOST=1
    121 CFGFLAGS += -D$(ENDIAN)
    122 CFGFLAGS += -DBCM_PLATFORM_STRING=\"X86\"
    123 CFGFLAGS += -DSAL_BDE_DMA_MEM_DEFAULT=32
    124 
    125 # Extra variables.
    126 EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
    127 
    128 comma = ,
    129 basetarget = $(basename $(notdir $@))
    130 modname = $(basetarget)
    131 
    132 name-fix = $(subst $(comma),_,$(subst -,_,$1))
    133 basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
    134 modname_flags  = $(if $(filter 1,$(words $(modname))),\
    135 -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
    136 
    137 ifneq ($(targetplat),user)
    138 # By default we exclude -Werror from x86 kernel builds
    139 BCM_CFLAGS   = -Wall
    140 include ${SDK}/make/Makefile.linux-kernel-2_6
    141 endif
    142 
    143