blob: 22f9888538506a30ae6ee50916eef9a4aec778f5 [file] [log] [blame]
#*******************************************************************************
#
# Broadcom Proprietary and Confidential. Copyright (C) 2017,
# All Rights Reserved.
#
# This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom;
# the contents of this file may not be disclosed to third parties, copied
# or duplicated in any form, in whole or in part, without the prior
# written permission of Broadcom.
#
#
# <<Broadcom-WL-IPTag/Proprietary:>>
#
# $Id: Makerules.env 514727 2014-11-12 03:02:48Z $
# Top-level Makerules for defining environment variables
# can be included by anyone doing software at Epigram
#*******************************************************************************
# HOSTOS is either unix or Windows_NT.
# HOSTENV differentiates HOSTOS and is either freebsd, sun4, or Windows_NT.
# This refers to the *BUILD* environment. All environments use "GNU C"
# except Windows_NT which may use "GNU C" or "Microsoft C".
ifndef HOSTENV
# Figure what type of host we are in.
UNAME = $(shell uname)
ifneq ($(findstring "$(UNAME)", "FreeBSD" "NetBSD"), )
HOSTENV = freebsd
HOSTOS = unix
else
ifneq ($(findstring "$(UNAME)", "sun4" "SunOS"), )
HOSTENV = sun4
HOSTOS = unix
else
ifeq ($(UNAME), Linux)
HOSTENV = linux
HOSTOS = unix
else
ifneq ($(findstring CYGWIN,$(UNAME)),)
HOSTENV = Windows_NT
HOSTOS = Windows_NT
else
ifeq ($(UNAME), Darwin)
HOSTENV = macos
HOSTOS = unix
else
HOSTENV = unknown
HOSTOS = unknown
endif
endif
endif
endif
endif
endif
# In case we just defined them, make sure they are known
export HOSTENV
export HOSTOS
# TARGETENV is one of freebsd, sun4, linux, linuxarm, android, android_ndk_r6b, linuxmips, linuxmips_be, cygwin32, win32, or macos
# TARGETENV defaults to HOSTENV unless HOSTENV is Windows_NT, in
# which case it defaults to win32.
ifndef TARGETENV
ifeq ($(HOSTENV), Windows_NT)
TARGETENV = win32
else
TARGETENV = $(HOSTENV)
endif
endif
export TARGETENV
# TARGETOS defaults to HOSTOS in most cases
ifneq ($(findstring "$(TARGETENV)", "freebsd" "freebsd_be" "linux" "linuxarm" "linuxarm_le" "android" "android_ndk_r6b" "linuxmips" "linuxmips_be" "sun4" "cygwin32" "win32" "macos"), )
TARGETOS = $(HOSTOS)
endif
ifeq ($(TARGETENV), bcmmips)
TARGETOS = bcmmips
endif
ifeq ($(TARGETENV), klsi)
TARGETOS = klsi
endif
ifeq ($(TARGETENV), nucleusarm)
TARGETOS = nucleus
endif
ifndef TARGETOS
TARGETOS = unknown
endif
export TARGETOS
# TARGETARCH is the target processor architecture
# Currently valid values are: x86, x86_mmx, sparc, unknown, or a list of any
# of the valid values.
# For the x86* family, a generic x86 is assuemd if not otherwise specified
# Order is important since "linux" matches both linuxmips and linux.
ifndef TARGETARCH
ifneq ($(findstring "$(TARGETENV)", "android"), )
TARGETARCH = arm_android
endif
ifneq ($(findstring "$(TARGETENV)", "android_ndk_r6b"), )
TARGETARCH = arm_android_ndk_r6b
endif
ifneq ($(findstring "$(TARGETENV)", "linuxarm_le"), )
TARGETARCH = arm_le
endif
ifneq ($(findstring "$(TARGETENV)", "linuxarm nucleusarm"), )
TARGETARCH = arm
endif
ifneq ($(findstring "$(TARGETENV)", "bcmmips" "linuxmips" "linuxmips_be"), )
TARGETARCH = mips
endif
ifneq ($(findstring "$(TARGETENV)", "sun4"), )
TARGETARCH = sparc
endif
ifneq ($(findstring "$(TARGETENV)", "freebsd" "linux" "cygwin32" "win32"), )
TARGETCPU = $(shell uname -m)
ifneq ($(findstring "$(TARGETCPU)", "sparc" "sparc64"), )
TARGETARCH = $(TARGETCPU)
else
TARGETARCH = x86_mmx
endif
endif
ifeq ($(TARGETENV), macos)
TARGETCPU = $(shell uname -p)
ifneq ($(findstring "$(TARGETCPU)", "powerpc"), )
TARGETARCH = PPC
else
TARGETARCH = x86
endif
endif
ifeq ($(TARGETENV), klsi)
TARGETARCH = klsi
endif
ifndef TARGETARCH
TARGETARCH = unknown
endif
endif
export TARGETARCH
# TARGET_TYPE is either "all" or one or more of: float64, float32, int16
# default is int16. "all" will get expanded into a list of all possible types
ifndef TARGET_TYPE
TARGET_TYPE = int16
endif
ifeq ($(TARGET_TYPE), all)
TARGET_TYPE = int16 float32 float64
endif
export TARGET_TYPE