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-iproc_64 (4152B)


      1 #
      2 #  Copyright 2017 Broadcom
      3 #  
      4 #  This program is free software; you can redistribute it and/or modify
      5 #  it under the terms of the GNU General Public License, version 2, as
      6 #  published by the Free Software Foundation (the "GPL").
      7 #  
      8 #  This program is distributed in the hope that it will be useful, but
      9 #  WITHOUT ANY WARRANTY; without even the implied warranty of
     10 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     11 #  General Public License version 2 (GPLv2) for more details.
     12 #  
     13 #  You should have received a copy of the GNU General Public License
     14 #  version 2 (GPLv2) along with this source code.
     15 #
     16 # $Id: Makefile.linux-iproc Exp $
     17 # $Copyright: (c) 2007 Broadcom Corp.
     18 # All Rights Reserved.$
     19 # Makefile for iproc-CMICd
     20 
     21 # User must select one platform from below.By default ARM_LINUX is selected. .
     22 ifeq (,$(BUILD_PLATFORM))
     23 BUILD_PLATFORM=ARM_LINUX
     24 endif
     25 
     26 # TOOLCHAIN_BASE_DIR    Toolchain base directory for iPROC-CMICd devices
     27 # TARGET_ARCHITECTURE   Compiler for target architecture
     28 # KERNDIR               Kernel directory for iPROC-CMICd devices
     29 ifeq (BE,$(ENDIAN_MODE))
     30 #We've never actually built a 64 BE executable.  Just here for any future
     31 #customer requirements.
     32 TOOLCHAIN_BASE_DIR ?= /projects/ntsw-tools/linux/iproc_ldks/xldk51-be/XLDK64
     33 TARGET_ARCHITECTURE ?= aarch64_be-broadcom-linux-uclibc
     34 KERNDIR ?= $(TOOLCHAIN_BASE_DIR)/kernel/linux
     35 else
     36 TOOLCHAIN_BASE_DIR ?= /projects/ntsw-tools/linux/iproc_ldks/xldk51/XLDK64
     37 TARGET_ARCHITECTURE ?= aarch64-broadcom-linux-uclibc
     38 KERNDIR ?= $(TOOLCHAIN_BASE_DIR)/kernel/linux
     39 endif
     40 
     41 ifeq (,$(CROSS_COMPILE))
     42 CROSS_COMPILE:= $(TARGET_ARCHITECTURE)-
     43 endif
     44 
     45 # A72 tools
     46 TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_BASE_DIR)/buildroot/host/usr/bin
     47 override PATH:=$(TOOLCHAIN_BASE_DIR)/buildroot/host/usr/$(TARGET_ARCHITECTURE)/bin:$(TOOLCHAIN_BIN_DIR):$(PATH)
     48 LD_LIBRARY_PATH=$(TOOLCHAIN_BASE_DIR)/buildroot/host/usr/lib
     49 export TOOLCHAIN_BIN_DIR LD_LIBRARY_PATH
     50 
     51 CROSS_GCC_VER ?= $(shell $(TOOLCHAIN_BIN_DIR)/$(CROSS_COMPILE)gcc -dumpversion)
     52 
     53 # Default Linux include directory
     54 ifeq (,$(LINUX_INCLUDE))
     55 LINUX_INCLUDE := $(KERNDIR)/include
     56 endif
     57 
     58 ifeq (BE,$(ENDIAN_MODE))
     59 CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1
     60 ENDIAN = BE_HOST=1
     61 else
     62 CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=0
     63 ENDIAN = LE_HOST=1
     64 endif
     65 
     66 CFLAGS += -DPTRS_ARE_64BITS -DLONGS_ARE_64BITS
     67 CFLAGS += -DPHYS_ADDRS_ARE_64BITS
     68 CFLAGS += -fno-aggressive-loop-optimizations -fno-strict-overflow
     69 CFLAGS += -Wno-error=maybe-uninitialized
     70 CFLAGS += -Wno-error=array-bounds
     71 CFLAGS += -fgnu89-inline
     72 ifeq "$(shell expr `echo $(CROSS_GCC_VER) | cut -f1 -d.` \>= 7)" "1"
     73     CFLAGS += -Wno-error=bool-operation
     74 endif
     75 
     76 
     77 CFGFLAGS += -D$(ENDIAN) -DIPROC_CMICD
     78 CFGFLAGS += -DBCM_PLATFORM_STRING=\"IPROC_CMICD\"
     79 CFGFLAGS += -DSAL_BDE_DMA_MEM_DEFAULT=16
     80 
     81 ARCH = arm64
     82 KBUILD_VERBOSE = 1
     83 
     84 export ARCH KBUILD_VERBOSE
     85 
     86 comma = ,
     87 basetarget = $(basename $(notdir $@))
     88 modname = $(basetarget)
     89 
     90 # Extra variables.
     91 EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
     92 
     93 name-fix = $(subst $(comma),_,$(subst -,_,$1))
     94 basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
     95 modname_flags  = $(if $(filter 1,$(words $(modname))),\
     96                  -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
     97 
     98 KFLAG_INCLD ?= $(LD_LIBRARY_PATH)/gcc/$(TARGET_ARCHITECTURE)/$(CROSS_GCC_VER)/include
     99 
    100 ifeq (,$(KFLAGS))
    101 KFLAGS := -D__LINUX_ARM_ARCH__=8 -D__KERNEL__ -DPTRS_ARE_64BITS -DLONGS_ARE_64BITS -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/generated/autoconf.h -I$(KERNDIR)/arch/arm64/include -I$(KERNDIR)/arch/arm64/include/generated -I$(KERNDIR)/arch/arm64/include/generated/uapi -I$(KERNDIR)/arch/arm64/include/generated/asm -I$(KERNDIR)/include/uapi -I$(KERNDIR)/include/generated/uapi -I$(KERNDIR)/arch/arm64/include/uapi  -Wall -Wstrict-prototypes -Wno-trigraphs -Os -fno-strict-aliasing -fno-common -fno-pic -pipe -ffreestanding -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -mcmodel=large
    102 endif
    103 
    104 ifneq ($(targetplat),user)
    105 include ${SDK}/make/Makefile.linux-kernel-3_6
    106 endif