Makefile.linux-kernel-3_13 (3539B)
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 # Configuration Flags 7 8 # Filter out features that cannot or should not be supported in kernel mode 9 10 _FEATURE_EXCLUDE_LIST += EDITLINE TCL OOB_RCPU CINT APIMODE DUNE_UI C_UNIT 11 FEATURE_EXCLUDE_LIST = $(sort $(_FEATURE_EXCLUDE_LIST)) 12 13 # Tools 14 15 # Conditionally Replaces DEFAULT var 16 ifeq ($(origin CC),default) 17 CC = $(LSRUN) $(CROSS_COMPILE)gcc 18 endif 19 20 ifeq ($(origin CXX),default) 21 CXX = $(CROSS_COMPILE)g++ 22 endif 23 24 ifeq ($(origin LD),default) 25 LD = $(CROSS_COMPILE)ld 26 endif 27 28 ifeq ($(origin AR),default) 29 AR = $(CROSS_COMPILE)ar 30 endif 31 32 ifeq ($(origin AS),default) 33 AS = $(CROSS_COMPILE)as 34 endif 35 36 ifeq ($(origin ARFLAGS),default) 37 ARFLAGS = -rc 38 endif 39 40 STRIP = $(CROSS_COMPILE)strip 41 RANLIB = $(CROSS_COMPILE)ranlib 42 OBJCOPY = $(CROSS_COMPILE)objcopy 43 NM = $(CROSS_COMPILE)nm 44 45 # Handle differences between gcc 2.x and gcc 3.x 46 gcc-tune-flag = $(shell if ${CC} -dumpspecs | grep mcpu >/dev/null; then echo cpu; else echo tune; fi) 47 48 # Configuration Variables 49 50 # OSType Defines: This defines the type of RTOS or microkernel which you 51 # are compiling the SAL (and its associated driver) for. New platforms 52 # can be created by porting the routines (system.c) to your platform and 53 # adding the define in this Makefile. 54 55 OSTYPE = LINUX 56 57 # 58 # ORIGIN is used to Optionally select different CFLAGS. It is used to import 59 # source from other vendors. If SOURCE=Broadcom, then the BCM_ flags are added 60 # to those passed to the compiler. If SOURCE != Broadcom, BCM_ flags are NOT 61 # added. 62 # 63 # Default specifies Broadcom 64 # 65 ifndef ORIGIN 66 ORIGIN = Broadcom 67 endif 68 69 # 70 # STD_{C|CPP|CXX}FLAGS - Standard flags used by ALL compilations 71 # BCM_{C|CPP|CXX}FLAGS - Flags used for Broadcom source files 72 # OPT_{C|CPP|CXX}FLAGS - Defined in local make files BEFORE inclusion of 73 # this Makefile, to define local "Extra" flags. 74 # 75 76 ifdef IPROC_BUILD 77 CFGFLAGS += -I$(SDK)/systems/linux/kernel/modules/include \ 78 -I$(SDK)/systems/bde/linux/include \ 79 -I$(LINUX_INCLUDE) \ 80 -I$(KERNDIR)/arch/$(ARCH) 81 else 82 CFGFLAGS += -I$(SDK)/systems/linux/kernel/modules/include \ 83 -I$(SDK)/systems/bde/linux/include \ 84 -I$(LINUX_INCLUDE) \ 85 -I$(LINUX_INCLUDE)/asm/gcc \ 86 -I$(LINUX_INCLUDE)/asm/mach-generic \ 87 -I$(KERNDIR)/arch/$(ARCH) 88 endif 89 90 CFGFLAGS += -D_SIMPLE_MEMORY_ALLOCATION_=0 91 92 CFGFLAGS += -DNO_FILEIO -DNO_CTRL_C -DNO_MEMTUNE 93 94 CFGFLAGS += -D$(OSTYPE) 95 96 # No user sal for the linux kernel 97 # NO_SAL_APPL=1 98 99 STD_CFLAGS = $(KFLAGS) $(CFGFLAGS) 100 101 102 STD_CPPFLAGS = ${STD_CFLAGS} 103 STD_CXXFLAGS = ${STD_CFLAGS} 104 105 ifndef BCM_CFLAGS 106 BCM_CFLAGS = -Wall 107 endif 108 109 BCM_CPPFLAGS = ${BCM_CFLAGS} 110 BCM_CXXFLAGS = ${BCM_CFLAGS} 111 112 ifeq (${ORIGIN}, Broadcom) 113 CFLAGS += ${STD_CFLAGS} ${BCM_CFLAGS} ${OPT_CFLAGS} 114 CPPFLAGS += ${STD_CPPFLAGS} ${BCM_CPPFLAGS} ${OPT_CPPFLAGS} 115 CXXFLAGS += ${STD_CXXFLAGS} ${BCM_CXXFLAGS} ${OPT_CXXFLAGS} 116 else 117 CFLAGS += ${STD_CFLAGS} ${OPT_CFLAGS} 118 CPPFLAGS += ${STD_CPPFLAGS} ${OPT_CPPFLAGS} 119 CXXFLAGS += ${STD_CXXFLAGS} ${OPT_CXXFLAGS} 120 endif 121 122 # 123 # Ignore pedantic flag for kernel modules 124 # 125 ifdef DEBUG_PEDANTIC 126 DEBUG_PEDANTIC = FALSE 127 endif 128 129 # 130 # DEPEND is used as a command to generate the list of dependencies. 131 # The format of the output must be 132 # "file.o : file.c a/b/c.h d/e/f.h ...", 133 # if it is on multiple lines, each line must end in a backslash. 134 # The output MUST be on standard out. 135 # 136 DEPEND = ${CC} -M $(CFLAGS) $<