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