Makefile.linux-iproc-4_4 (3615B)
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 TOOLCHAIN_BASE_DIR ?= /projects/ntsw-tools/linux/iproc_ldks/xldk40-be/XLDK 31 TARGET_ARCHITECTURE:=armeb-broadcom-linux-uclibcgnueabi 32 KERNDIR ?= $(TOOLCHAIN_BASE_DIR)/kernel/linux 33 else 34 TOOLCHAIN_BASE_DIR ?= /projects/ntsw-tools/linux/iproc_ldks/xldk40/XLDK 35 TARGET_ARCHITECTURE:= arm-broadcom-linux-uclibcgnueabi 36 KERNDIR ?= $(TOOLCHAIN_BASE_DIR)/kernel/linux 37 endif 38 39 ifeq (,$(CROSS_COMPILE)) 40 CROSS_COMPILE:= $(TARGET_ARCHITECTURE)- 41 endif 42 43 # arm9tools 44 TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_BASE_DIR)/buildroot/host/usr/bin 45 override PATH:=$(TOOLCHAIN_BASE_DIR)/buildroot/host/usr/$(TARGET_ARCHITECTURE)/bin:$(TOOLCHAIN_BIN_DIR):$(PATH) 46 LD_LIBRARY_PATH=$(TOOLCHAIN_BASE_DIR)/buildroot/host/usr/lib 47 48 export TOOLCHAIN_BIN_DIR LD_LIBRARY_PATH 49 50 # Default Linux include directory 51 ifeq (,$(LINUX_INCLUDE)) 52 LINUX_INCLUDE := $(KERNDIR)/include 53 endif 54 55 ifeq (BE,$(ENDIAN_MODE)) 56 CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1 57 ENDIAN = BE_HOST=1 58 else 59 CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=0 60 ENDIAN = LE_HOST=1 61 endif 62 63 CFGFLAGS += -D$(ENDIAN) -DIPROC_CMICD 64 CFGFLAGS += -DBCM_PLATFORM_STRING=\"IPROC_CMICD\" 65 66 ARCH = arm 67 KBUILD_VERBOSE = 1 68 69 export ARCH KBUILD_VERBOSE 70 71 comma = , 72 basetarget = $(basename $(notdir $@)) 73 modname = $(basetarget) 74 75 # Extra variables. 76 EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) 77 78 name-fix = $(subst $(comma),_,$(subst -,_,$1)) 79 basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))" 80 modname_flags = $(if $(filter 1,$(words $(modname))),\ 81 -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") 82 83 KFLAG_INCLD ?= $(TOOLCHAIN_BASE_DIR)/buildroot/host/usr/lib/gcc/$(TARGET_ARCHITECTURE)/4.9.3/include 84 85 ifeq (,$(KFLAGS)) 86 KFLAGS := -D__LINUX_ARM_ARCH__=7 -D__KERNEL__ -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/generated/autoconf.h -I$(KERNDIR)/arch/arm/include -I$(KERNDIR)/arch/arm/include/generated -I$(KERNDIR)/arch/arm/mach-iproc/include -Wall -Wstrict-prototypes -Wno-trigraphs -Os -fno-strict-aliasing -fno-common -marm -mabi=aapcs-linux -fno-pic -pipe -msoft-float -ffreestanding -march=armv7-a -mfpu=vfp -mfloat-abi=softfp -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -mlong-calls 87 KFLAGS += -I$(LINUX_INCLUDE)/uapi -I$(LINUX_INCLUDE)/generated/uapi -I$(KERNDIR)/arch/arm/include/uapi -I$(KERNDIR)/arch/arm/include/generated/uapi 88 endif 89 90 ifneq ($(targetplat),user) 91 include ${SDK}/make/Makefile.linux-kernel-3_6 92 endif