# ARCH = ia64 or IA64 for IA64 build\r
# ARCH = Arm or ARM for ARM build\r
#\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
LINUX:=$(findstring Linux, $(shell uname -s))\r
DARWIN:=$(findstring Darwin, $(shell uname -s))\r
\r
-CC = gcc\r
-CXX = g++\r
-AS = gcc\r
-AR = ar\r
-LD = ld\r
-LINKER ?= $(CC)\r
+BUILD_CC ?= gcc\r
+BUILD_CXX ?= g++\r
+BUILD_AS ?= gcc\r
+BUILD_AR ?= ar\r
+BUILD_LD ?= ld\r
+LINKER ?= $(BUILD_CC)\r
ifeq ($(ARCH), IA32)\r
ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/\r
endif\r
ARCH_INCLUDE = -I $(MAKEROOT)/Include/Arm/\r
endif\r
\r
+ifeq ($(ARCH), AARCH64)\r
+ARCH_INCLUDE = -I $(MAKEROOT)/Include/AArch64/\r
+endif\r
+\r
INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE) \r
-CPPFLAGS = $(INCLUDE)\r
-CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -nostdlib -c -g\r
-LFLAGS =\r
+BUILD_CPPFLAGS = $(INCLUDE)\r
+ifeq ($(DARWIN),Darwin)\r
+# assume clang or clang compatible flags on OS X\r
+BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -nostdlib -c -g\r
+else\r
+BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -nostdlib -c -g\r
+endif\r
+BUILD_LFLAGS =\r
+BUILD_CXXFLAGS =\r
\r
ifeq ($(ARCH), IA32)\r
#\r
# to x86_64. So make sure tools match uname -m. You can manual have a 64-bit kernal on Snow Leopard\r
# so only do this is uname -m returns i386.\r
#\r
-uname_s = $(shell uname -s)\r
-ifeq ($(uname_s),Darwin)\r
- CFLAGS += -arch i386\r
- CPPFLAGS += -arch i386\r
- LFLAGS += -arch i386\r
+ifeq ($(DARWIN),Darwin)\r
+ BUILD_CFLAGS += -arch i386\r
+ BUILD_CPPFLAGS += -arch i386\r
+ BUILD_LFLAGS += -arch i386\r
endif\r
endif\r
\r