Makefile.linux-gts (4616B)
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/linux/xlr-419 25 TOOLCHAIN_DIR = $(XLR_TOOLS_BASE)/buildroot/host/usr 26 KERNDIR = $(XLR_TOOLS_BASE)/kernel/linux 27 28 # set up cross compile prefix, tools dir variables. # 29 export CROSS_COMPILE := x86_64-broadcom-linux-gnu- 30 export TOOLS_DIR := $(TOOLCHAIN_DIR)/bin 31 32 # architecture. # 33 ARCH = x86_64 34 TARGET_ARCHITECTURE = x86_64-broadcom-linux-gnu 35 36 # Noisy kernel build 37 KBUILD_VERBOSE = 1 38 39 export ARCH KBUILD_VERBOSE 40 41 # set up paths. # 42 export LIBRARY_PATH := $(TOOLCHAIN_DIR)/lib:$(TOOLCHAIN_DIR)/lib64:$(LIBRARY_PATH) 43 export PATH := $(TOOLCHAIN_DIR)/bin:$(KERNDIR):$(PATH) 44 45 # set up SYSINC path # 46 export SYSINC := $(XLR_TOOLS_BASE)/buildroot/host/usr/lib/gcc/$(TARGET_ARCHITECTURE)/5.4.0/include 47 48 49 # CFLAGS/CFGFLAGS # 50 CFLAGS += -DUSE_LINUX_BDE_MMAP=1 51 #CFLAGS += -DBDE_LINUX_USE_MSI_INTERRUPT 52 CFLAGS += -Wno-error=unused-value 53 CFLAGS += -Wno-error=unused-but-set-variable 54 CFLAGS += -Wno-error=maybe-uninitialized 55 CFLAGS += -Wno-error=cpp 56 CFLAGS += -Wno-error=aggressive-loop-optimizations 57 CFLAGS += -Wno-error=array-bounds 58 CFLAGS += -Wno-error=strict-overflow 59 CFLAGS += -L$(TOOLCHAIN_DIR)/lib 60 CFLAGS += -L$(TOOLCHAIN_DIR)/lib64 61 #CFLAGS += -Wl,--rpath=/lib64 # may need to set rpath and dynamic-linker path here (and possibly in KLFAGS below) in the future, # 62 #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 # 63 64 # set up KFLAGS appropriately. # 65 ifeq (,$(KFLAGS)) 66 KFLAGS := -L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib64 -I$(KERNDIR) -lc -nostdinc -isystem $(SYSINC) -Iinclude -I$(KERNDIR)/arch/x86/include -I$(KERNDIR)/arch/x86/include/generated -I$(KERNDIR)/arch/x86/include/generated/uapi -I$(KERNDIR)/arch/x86/include/uapi -I$(KERNDIR)/include -I$(KERNDIR)/include/generated -I$(KERNDIR)/include/generated/uapi -I$(KERNDIR)/include/uapi -include $(KERNDIR)/include/generated/autoconf.h -D__KERNEL__ -DNDEBUG -Wundef -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-dwarf2-cfi-asm -fconserve-stack 67 endif 68 69 70 ###################################################################### 71 # this segment comes from make/Makefile.linux-x86-smp_generic_64-2_6 # 72 ###################################################################### 73 CFGFLAGS += -DLONGS_ARE_64BITS 74 CFGFLAGS += -DPTRS_ARE_64BITS 75 CFGFLAGS += -DSAL_SPL_LOCK_ON_IRQ 76 77 78 ############################################################## 79 # This segment comes from make/Makefile.linux-x86-common-2_6 # 80 ############################################################## 81 CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=0 82 ENDIAN = LE_HOST=1 83 CFGFLAGS += -D$(ENDIAN) 84 CFGFLAGS += -DBCM_PLATFORM_STRING=\"X86\" 85 CFGFLAGS += -DSAL_BDE_DMA_MEM_DEFAULT=32 86 87 # Extra variables. 88 EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) 89 90 comma = , 91 basetarget = $(basename $(notdir $@)) 92 modname = $(basetarget) 93 94 name-fix = $(subst $(comma),_,$(subst -,_,$1)) 95 basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))" 96 modname_flags = $(if $(filter 1,$(words $(modname))),\ 97 -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") 98 99 ifneq ($(targetplat),user) 100 # By default we exclude -Werror from x86 kernel builds 101 BCM_CFLAGS = -Wall 102 include ${SDK}/make/Makefile.linux-kernel-2_6 103 endif 104 105