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-4_4 (6126B)


      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/xlr
     26 KERNDIR       = $(XLR_TOOLS_BASE)/linux/fedora-21-x86_64/kernel-4.4.6
     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 CFLAGS += -DUSE_LINUX_BDE_MMAP=1
     45 #CFLAGS += -DBDE_LINUX_USE_MSI_INTERRUPT
     46 CFLAGS += -Wno-error=unused-value
     47 CFLAGS += -Wno-error=unused-but-set-variable
     48 CFLAGS += -Wno-error=maybe-uninitialized
     49 CFLAGS += -Wno-error=cpp
     50 CFLAGS += -Wno-error=aggressive-loop-optimizations
     51 CFLAGS += -Wno-error=array-bounds
     52 CFLAGS += -L$(TOOLCHAIN_DIR)/lib
     53 CFLAGS += -L$(TOOLCHAIN_DIR)/lib64
     54 #CFLAGS += -Wl,--rpath=/lib64                                 # may need to set rpath and dynamic-linker path here (and possibly in KLFAGS below) in the future, #
     55 #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 #
     56 
     57 # set up KFLAGS appropriately. #
     58 ifeq (,$(KFLAGS))
     59 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
     60 endif
     61 
     62 
     63 ######################################################################
     64 # this segment comes from make/Makefile.linux-x86-smp_generic_64-2_6 #
     65 ######################################################################
     66 CFGFLAGS += -DLONGS_ARE_64BITS
     67 CFGFLAGS += -DPTRS_ARE_64BITS
     68 CFGFLAGS += -DSAL_SPL_LOCK_ON_IRQ
     69 
     70 
     71 ###########################################################################################
     72 # This segment comes from make/Makefile.linux-x86-generic-common-2_6 (with modifications) #
     73 ###########################################################################################
     74 
     75 # Default kernel source directory
     76 ifeq (,$(KERNDIR))
     77 KERNDIR := /lib/modules/$(shell uname -r)/build
     78 export KERNDIR
     79 endif
     80 
     81 # Default architecture
     82 ifeq (,$(ARCH))
     83 ARCH = x86_64
     84 endif
     85 
     86 # Noisy kernel build
     87 KBUILD_VERBOSE = 1
     88 
     89 export ARCH KBUILD_VERBOSE KERNDIR
     90 
     91 # Default Linux include directory
     92 ifeq (,$(LINUX_INCLUDE))
     93 LINUX_INCLUDE := $(KERNDIR)/include
     94 endif
     95 
     96 # autoconf.h was moved in later kernels
     97 AUTOCONF = $(KERNDIR)/include/generated/autoconf.h
     98 ifeq (,$(shell ls $(AUTOCONF) 2>/dev/null))
     99 AUTOCONF = $(KERNDIR)/include/linux/autoconf.h
    100 endif
    101 
    102 # gcc system include path
    103 #SYSINC = $(shell gcc -print-search-dirs | grep install | cut -c 10-)include
    104 
    105 
    106 ifeq (,$(KFLAGS))
    107 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
    108 endif
    109 
    110 
    111 
    112 ##############################################################
    113 # This segment comes from make/Makefile.linux-x86-common-2_6 #
    114 ##############################################################
    115 CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=0
    116 ENDIAN = LE_HOST=1
    117 CFGFLAGS += -D$(ENDIAN)
    118 CFGFLAGS += -DBCM_PLATFORM_STRING=\"X86\"
    119 CFGFLAGS += -DSAL_BDE_DMA_MEM_DEFAULT=32
    120 
    121 # Extra variables.
    122 EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
    123 
    124 comma = ,
    125 basetarget = $(basename $(notdir $@))
    126 modname = $(basetarget)
    127 
    128 name-fix = $(subst $(comma),_,$(subst -,_,$1))
    129 basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
    130 modname_flags  = $(if $(filter 1,$(words $(modname))),\
    131 -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
    132 
    133 ifneq ($(targetplat),user)
    134 # By default we exclude -Werror from x86 kernel builds
    135 BCM_CFLAGS   = -Wall
    136 include ${SDK}/make/Makefile.linux-kernel-2_6
    137 endif
    138 
    139