]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/Makefiles/header.makefile
BaseTools GNU makefile: Add BUILD_CXXFLAGS to align make built-in rule
[mirror_edk2.git] / BaseTools / Source / C / Makefiles / header.makefile
index 30495877974630a08c68c48e3abee147fbd71b5f..f2041f8f03f05cdbd8127893594273e019d39ad1 100644 (file)
@@ -6,7 +6,7 @@
 # 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
@@ -21,12 +21,12 @@ CYGWIN:=$(findstring CYGWIN, $(shell uname -s))
 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
@@ -39,10 +39,20 @@ ifeq ($(ARCH), ARM)
 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
@@ -50,11 +60,10 @@ ifeq ($(ARCH), IA32)
 #  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