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.unix-linux-64 (1904B)


      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 # Build rules for Linux/x86 (Little Endian) with PLI support
      7 
      8 include ${SDK}/make/Makefile.unix-common
      9 
     10 # When using GDB on Linux, you may want to use "setenv GDB 1" to disable
     11 # editline.  For best results put "set environment GDB 1" in your .gdbinit.
     12 
     13 # Linux-specific Configuration Flags
     14 
     15 ENDIAN_DEF = -DLE_HOST=1
     16 
     17 # Notes on AMD Athlon 64-bit
     18 #
     19 # Compiles on x86_64 default to 32-bit emulation unless 64-bit mode
     20 # is specifically requested in Make.local by uncommenting the two defines
     21 # for PTRS_ARE_64BITS and LONGS_ARE_64BITS.
     22 #
     23 # Note that the code base will compile in 64-bit mode, but will not run
     24 # correctly because malloc() can return values >32 bits and the PLISIM
     25 # protocol only supports 32-bit addresses.
     26 
     27 ifeq ($(shell uname -m),x86_64)
     28  ifeq (,$(findstring -DPTRS_ARE_64BITS,$(CFGFLAGS)))
     29   CC = ${HCC} -m32
     30   CXX = g++ -m32
     31  else
     32   CC = ${HCC}
     33   CXX = g++
     34  endif
     35 endif
     36 
     37 # Currently, this LD definitely seems to only be used for building
     38 # the SBX FE-2000 simulation target
     39 LD	= ld -melf_i386
     40 AR	= ar
     41 ARFLAGS	= -rc
     42 STRIP	= strip
     43 RANLIB  = ranlib
     44 
     45 # Filter out features that cannot or should not be supported in Linux
     46 ifdef ESW_CHIPS
     47 _FEATURE_EXCLUDE_LIST += OOB_RCPU
     48 endif
     49 FEATURE_EXCLUDE_LIST = $(sort $(_FEATURE_EXCLUDE_LIST))
     50 
     51 # Linux
     52 LIBS =-lnsl -pthread -lm -lrt
     53 
     54 CFGFLAGS += -DBCM_PLATFORM_STRING=\"unix-linux-64\"
     55 
     56 # For GCC 4.2.x, add -Wno-address
     57 GCC_MAJOR_VER  = $(shell GCCVER=$(GCCVER) $(CC) -dumpversion | cut -d'.' -f1)
     58 GCC_MINOR_VER  = $(shell GCCVER=$(GCCVER) $(CC) -dumpversion | cut -d'.' -f2)
     59 ifeq (${GCC_MAJOR_VER}, 4)
     60 ifeq (${GCC_MINOR_VER}, 2)
     61 BCM_EXTRA_CC_CFLAGS   = -Wno-address
     62 endif
     63 endif
     64 
     65 ifeq ($(LINUX_MAKE_SHARED_LIB),1)
     66 BCM_EXTRA_CC_CFLAGS += -fPIC
     67 endif