# ===========================================================================
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2015-2016, Marvell International Ltd.
#
# Alternatively, this software may be distributed under the terms of the GNU
# General Public License Version 2, and any use shall comply with the terms and
# conditions of the GPL.  A copy of the GPL is available at
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
# IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
# ARE EXPRESSLY DISCLAIMED.  The GPL license provides additional details about
# this warranty disclaimer.
# ================================================================================

# This makefile assumes GNU make features
#
TEST ?= 1
SYSROOT ?= /home/hanping/gerrit/bit64/tmp/sysroots
#SYSROOT ?= /home/hanping/gerrit/bit32/build-bundle/poky/build/tmp/sysroots
ARM_ROOT ?= $(SYSROOT)/x86_64-linux/usr/bin/

MACHINE ?= granite2v8
#MACHINE ?= granite2

ifeq ($(MACHINE), granite2v8)
CCPREFIX ?= aarch64-poky-linux/aarch64-poky-linux-
# Set a Libs search var for the CC line
LIBPATH := $(SYSROOT)/$(MACHINE)/usr/lib64
else
CCPREFIX ?= armv7a-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi-
LIBPATH := $(SYSROOT)/$(MACHINE)/usr/lib
endif

CROSS_COMPILE ?= $(ARM_ROOT)$(CCPREFIX)

LD      := $(CROSS_COMPILE)ld --sysroot=$(SYSROOT)/$(MACHINE)
#LD      := $(CROSS_COMPILE)ld
CC      := $(CROSS_COMPILE)gcc --sysroot=$(SYSROOT)/$(MACHINE)
#CC      := $(CROSS_COMPILE)gcc

include Makefile
