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