Makefile.linux-iproc-3_14 (4087B)
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-3_6,v 1.1 Broadcom SDK $ 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/xldk37-be/buildroot-2013.11-gcc48-opt-broadcom 31 TARGET_ARCHITECTURE:=armeb-buildroot-linux-gnueabi 32 KERNDIR ?= /projects/ntsw-tools/linux/iproc_ldks/xldk37-be/XLDK/kernel/linux 33 else 34 TOOLCHAIN_BASE_DIR ?= /projects/ntsw-tools/linux/iproc_ldks/xldk37/XLDK 35 TARGET_ARCHITECTURE:= arm-broadcom-linux-uclibcgnueabi 36 KERNDIR ?= $(TOOLCHAIN_BASE_DIR)/kernel/linux 37 endif 38 39 40 ifeq (,$(CROSS_COMPILE)) 41 CROSS_COMPILE:= $(TARGET_ARCHITECTURE)- 42 endif 43 44 # arm9tools 45 ifeq (BE,$(ENDIAN_MODE)) 46 TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_BASE_DIR)/host/usr/bin 47 override PATH:=$(TOOLCHAIN_BASE_DIR)/host/usr/$(TARGET_ARCHITECTURE)/bin:$(TOOLCHAIN_BIN_DIR):$(PATH) 48 LD_LIBRARY_PATH=$(TOOLCHAIN_BASE_DIR)/host/usr/lib 49 else 50 TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_BASE_DIR)/buildroot/usr/bin 51 override PATH:=$(TOOLCHAIN_BASE_DIR)/buildroot/usr/$(TARGET_ARCHITECTURE)/bin:$(TOOLCHAIN_BIN_DIR):$(PATH) 52 LD_LIBRARY_PATH=$(TOOLCHAIN_BASE_DIR)/buildroot/usr/lib 53 endif 54 55 export TOOLCHAIN_BIN_DIR LD_LIBRARY_PATH 56 57 # Default Linux include directory 58 ifeq (,$(LINUX_INCLUDE)) 59 LINUX_INCLUDE := $(KERNDIR)/include 60 endif 61 62 ifeq (BE,$(ENDIAN_MODE)) 63 CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1 64 ENDIAN = BE_HOST=1 65 else 66 CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=0 67 ENDIAN = LE_HOST=1 68 endif 69 70 CFGFLAGS += -D$(ENDIAN) -DIPROC_CMICD 71 CFGFLAGS += -DBCM_PLATFORM_STRING=\"IPROC_CMICD\" 72 73 ARCH = arm 74 KBUILD_VERBOSE = 1 75 76 export ARCH KBUILD_VERBOSE 77 78 comma = , 79 basetarget = $(basename $(notdir $@)) 80 modname = $(basetarget) 81 82 # Extra variables. 83 EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) 84 85 name-fix = $(subst $(comma),_,$(subst -,_,$1)) 86 basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))" 87 modname_flags = $(if $(filter 1,$(words $(modname))),\ 88 -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") 89 90 ifeq (BE,$(ENDIAN_MODE)) 91 KFLAG_INCLD ?= $(TOOLCHAIN_BASE_DIR)/host/usr/lib/gcc/$(TARGET_ARCHITECTURE)/4.8.2/include 92 else 93 KFLAG_INCLD ?= $(TOOLCHAIN_BASE_DIR)/buildroot/usr/lib/gcc/$(TARGET_ARCHITECTURE)/4.7.2/include 94 endif 95 96 ifeq (,$(KFLAGS)) 97 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-northstar/include -I$(KERNDIR)/arch/arm/plat-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 98 KFLAGS += -I$(LINUX_INCLUDE)/uapi -I$(LINUX_INCLUDE)/generated/uapi -I$(KERNDIR)/arch/arm/include/uapi -I$(KERNDIR)/arch/arm/include/generated/uapi 99 endif 100 101 ifneq ($(targetplat),user) 102 include ${SDK}/make/Makefile.linux-kernel-3_6 103 endif