To avoid the conflict with the default GCC flag name, BUILD_ prefix is added.
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
cp $(LIBRARY) $(MAKEROOT)/libs-$(ARCH)\r
\r
$(LIBRARY): $(OBJECTS) \r
cp $(LIBRARY) $(MAKEROOT)/libs-$(ARCH)\r
\r
$(LIBRARY): $(OBJECTS) \r
+ $(BUILD_AR) crs $@ $^\r
- $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@\r
+ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@\r
- $(AS) -c $(ASFLAGS) $< -o $@\r
+ $(BUILD_AS) -c $(BUILD_ASFLAGS) $< -o $@\r
- $(CXX) -c $(CPPFLAGS) $< -o $@\r
+ $(BUILD_CXX) -c $(BUILD_CPPFLAGS) $< -o $@\r
\r
.PHONY: clean\r
clean:\r
\r
.PHONY: clean\r
clean:\r
# ARCH = ia64 or IA64 for IA64 build\r
# ARCH = Arm or ARM for ARM build\r
#\r
# 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
# 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
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
ifeq ($(ARCH), IA32)\r
ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/\r
endif\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
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
+BUILD_CPPFLAGS = $(INCLUDE)\r
ifeq ($(DARWIN),Darwin)\r
# assume clang or clang compatible flags on OS X\r
ifeq ($(DARWIN),Darwin)\r
# assume clang or clang compatible flags on OS X\r
-CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -nostdlib -c -g\r
+BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -nostdlib -c -g\r
-CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -nostdlib -c -g\r
+BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -nostdlib -c -g\r
\r
ifeq ($(ARCH), IA32)\r
#\r
\r
ifeq ($(ARCH), IA32)\r
#\r
# so only do this is uname -m returns i386.\r
#\r
ifeq ($(DARWIN),Darwin)\r
# so only do this is uname -m returns i386.\r
#\r
ifeq ($(DARWIN),Darwin)\r
- CFLAGS += -arch i386\r
- CPPFLAGS += -arch i386\r
- LFLAGS += -arch i386\r
+ BUILD_CFLAGS += -arch i386\r
+ BUILD_CPPFLAGS += -arch i386\r
+ BUILD_LFLAGS += -arch i386\r
## @file\r
# GNU/Linux makefile for 'VfrCompile' module build.\r
#\r
## @file\r
# GNU/Linux makefile for 'VfrCompile' module build.\r
#\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 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
# 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
OBJECTS = AParser.o DLexerBase.o ATokenBuffer.o EfiVfrParser.o VfrLexer.o VfrSyntax.o \\r
VfrFormPkg.o VfrError.o VfrUtilityLib.o VfrCompiler.o\r
\r
OBJECTS = AParser.o DLexerBase.o ATokenBuffer.o EfiVfrParser.o VfrLexer.o VfrSyntax.o \\r
VfrFormPkg.o VfrError.o VfrUtilityLib.o VfrCompiler.o\r
\r
-VFR_CPPFLAGS = -DPCCTS_USE_NAMESPACE_STD $(CPPFLAGS)\r
+VFR_CPPFLAGS = -DPCCTS_USE_NAMESPACE_STD $(BUILD_CPPFLAGS)\r