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-x86-64-fc28 (5517B)


      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 # x86_64 build for Fedora 28 - system make file.
      8 #
      9 #
     10 
     11 
     12 #############################################################################
     13 # this segment is custom and not sourced from any existing makefile         #
     14 # (base thanks to http:<slash><slash>confluence.broadcom.com/display/NTSWSW/X86+System) #
     15 #############################################################################
     16 
     17 # set up a basic feature list. tcl, etc. #
     18 #ifeq (,$(FEATURE_LIST))
     19 #FEATURE_LIST = TCL BFD PTP CINT L3 I2C BCMX BCMX_DIAG MEM_SCAN EDITLINE BCM_SAL_PROFILE CUSTOMER TEST CHASSIS MSTP RCPU
     20 #endif
     21 
     22 # some basic path variables for tools and kernel source, etc #
     23 export GCCVER := 8.1.0
     24 export BINUTILSVER := 2.27
     25 # For GCC versions >= 4.7
     26 USE_GCC_TOOLS := 1
     27 #enables executables > 2GB
     28 #CFLAGS += -mcmodel=medium
     29 
     30 TOOLCHAIN_DIR = /tools/oss/packages/x86_64-rhel6/gcc/$(GCCVER)
     31 BINUTILS_DIR = /tools/oss/packages/x86_64-rhel6/binutils/$(BINUTILSVER)/bin
     32 #KERNDIR       ?= /projects/NTSW_SW_USRS_2/gili/FedoraKernel
     33 KERNDIR       ?= /projects/NTSW_SW_USRS_4/tools/FedoraKernel
     34 
     35 # set up cross compile prefix, tools dir variables. #
     36 #export CROSS_COMPILE := x86_64-fedora-linux-gnu-
     37 export TOOLS_DIR     := $(TOOLCHAIN_DIR)/bin
     38 
     39 # architecture. #
     40 ARCH                = x86_64
     41 #TARGET_ARCHITECTURE = x86_64-fedora-linux-gnu
     42 TARGET_ARCHITECTURE := x86_64-pc-linux-gnu
     43 
     44 ifeq (,$(BUILD_32BITS_EXEC))
     45 TOOLCHAIN_LIB_DIR:= $(TOOLCHAIN_DIR)/lib64
     46 else
     47 TOOLCHAIN_LIB_DIR:= $(TOOLCHAIN_DIR)/lib
     48 endif
     49 # set up paths. #
     50 #export LIBRARY_PATH := $(TOOLCHAIN_LIB_DIR):$(LIBRARY_PATH)
     51 export PATH         := $(TOOLS_DIR):$(BINUTILS_DIR):$(KERNDIR):$(PATH)
     52 
     53 # set up SYSINC path #
     54 export SYSINC := $(TOOLCHAIN_DIR)/lib/gcc/$(TARGET_ARCHITECTURE)/$(GCCVER)/include
     55 
     56 # CFLAGS/CFGFLAGS #
     57 CFLAGS += -DUSE_LINUX_BDE_MMAP=1
     58 #CFLAGS += -DBDE_LINUX_USE_MSI_INTERRUPT
     59 CFLAGS += -Wno-error=unused-value
     60 CFLAGS += -Wno-error=unused-but-set-variable
     61 CFLAGS += -Wno-error=maybe-uninitialized
     62 CFLAGS += -Wno-error=cpp
     63 CFLAGS += -Wno-error=aggressive-loop-optimizations
     64 CFLAGS += -Wno-error=array-bounds
     65 
     66 # set up KFLAGS appropriately. #
     67 # -fno-builtin needed for using kernel's version of memcpy instead of the gcc inline version
     68 ifeq (,$(KFLAGS))
     69 KFLAGS := -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 -fno-builtin
     70 endif
     71 
     72 
     73 ######################################################################
     74 # this segment comes from make/Makefile.linux-x86-smp_generic_64-2_6 #
     75 ######################################################################
     76 CFGFLAGS += -DSAL_SPL_LOCK_ON_IRQ
     77 
     78 ifeq (,$(BUILD_32BITS_EXEC))
     79 CFLAGS += -DPTRS_ARE_64BITS -DLONGS_ARE_64BITS
     80 else
     81 CFLAGS += -m32
     82 CFGFLAGS += -DSAL_BDE_32BIT_USER_64BIT_KERNEL
     83 endif
     84 CFLAGS += -DPHYS_ADDRS_ARE_64BITS
     85 
     86 
     87 ###########################################################################################
     88 # This segment comes from make/Makefile.linux-x86-generic-common-2_6 (with modifications) #
     89 ###########################################################################################
     90 
     91 # Default architecture
     92 ifeq (,$(ARCH))
     93 ARCH = x86_64
     94 endif
     95 
     96 # Noisy kernel build
     97 KBUILD_VERBOSE = 1
     98 
     99 export ARCH KBUILD_VERBOSE KERNDIR
    100 
    101 # Default Linux include directory
    102 ifeq (,$(LINUX_INCLUDE))
    103 LINUX_INCLUDE := $(KERNDIR)/include
    104 endif
    105 
    106 # autoconf.h was moved in later kernels
    107 AUTOCONF = $(KERNDIR)/include/generated/autoconf.h
    108 ifeq (,$(shell ls $(AUTOCONF) 2>/dev/null))
    109 AUTOCONF = $(KERNDIR)/include/linux/autoconf.h
    110 endif
    111 
    112 # gcc system include path
    113 #SYSINC = $(shell gcc -print-search-dirs | grep install | cut -c 10-)include
    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-4_18
    141 endif