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-kernel-2_6 (3503B)


      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 += -DNO_FILEIO -DNO_CTRL_C -DNO_MEMTUNE
     91 
     92 CFGFLAGS += -D$(OSTYPE)
     93 
     94 # No user sal for the linux kernel
     95 # NO_SAL_APPL=1
     96 
     97 STD_CFLAGS = $(KFLAGS) $(CFGFLAGS)
     98 
     99 
    100 STD_CPPFLAGS = ${STD_CFLAGS}
    101 STD_CXXFLAGS = ${STD_CFLAGS}
    102 
    103 ifndef BCM_CFLAGS
    104 BCM_CFLAGS   = -Wall -Werror
    105 endif
    106 
    107 BCM_CPPFLAGS = ${BCM_CFLAGS}
    108 BCM_CXXFLAGS = ${BCM_CFLAGS}
    109 
    110 ifeq (${ORIGIN}, Broadcom)
    111 	CFLAGS   += ${STD_CFLAGS}   ${BCM_CFLAGS}   ${OPT_CFLAGS}
    112 	CPPFLAGS += ${STD_CPPFLAGS} ${BCM_CPPFLAGS} ${OPT_CPPFLAGS}
    113 	CXXFLAGS += ${STD_CXXFLAGS} ${BCM_CXXFLAGS} ${OPT_CXXFLAGS}
    114 else
    115 	CFLAGS   += ${STD_CFLAGS}   ${OPT_CFLAGS}
    116 	CPPFLAGS += ${STD_CPPFLAGS} ${OPT_CPPFLAGS}
    117 	CXXFLAGS += ${STD_CXXFLAGS} ${OPT_CXXFLAGS}
    118 endif
    119 
    120 #
    121 # Ignore pedantic flag for kernel modules
    122 #
    123 ifdef DEBUG_PEDANTIC
    124 DEBUG_PEDANTIC = FALSE
    125 endif
    126 
    127 #
    128 # DEPEND is used as a command to generate the list of dependencies.
    129 # The format of the output must be 
    130 #	"file.o : file.c a/b/c.h d/e/f.h ...", 
    131 # if it is on multiple lines, each line must end in a backslash. 
    132 # The output MUST be on standard out.
    133 #
    134 DEPEND = ${CC} -M $(CFLAGS) $<