Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Andrew Fish <afish@apple.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>
Tested-By: Olivier Martin <olivier.martin@arm.com>
Reviewed-by: Gao, Liming <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16106
6f19259b-4bc3-4df7-8a09-
765794883524
\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
\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
+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
CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -nostdlib -c -g\r
+else\r
+CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -nostdlib -c -g\r
+endif\r
LFLAGS =\r
\r
ifeq ($(ARCH), IA32)\r
LFLAGS =\r
\r
ifeq ($(ARCH), IA32)\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
# 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
+ifeq ($(DARWIN),Darwin)\r
CFLAGS += -arch i386\r
CPPFLAGS += -arch i386\r
LFLAGS += -arch i386\r
CFLAGS += -arch i386\r
CPPFLAGS += -arch i386\r
LFLAGS += -arch i386\r