X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FC%2FMakefiles%2Fheader.makefile;h=6a759d94c7a6c04950ec670d2436b286b8825591;hp=006a0716caf93232745a2c43ffe66ef26cf02d13;hb=e0ba625fc641314438a9a46079b52a4a30d8679e;hpb=52302d4dee589a5df43a464420c9fe68ba83937d diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile index 006a0716ca..6a759d94c7 100644 --- a/BaseTools/Source/C/Makefiles/header.makefile +++ b/BaseTools/Source/C/Makefiles/header.makefile @@ -1,63 +1,80 @@ ## @file # -# The makefile can be invoked with -# ARCH = x86_64 or x64 for EM64T build -# ARCH = ia32 or IA32 for IA32 build -# ARCH = ia64 or IA64 for IA64 build -# -# Copyright (c) 2007 - 2010, Intel Corporation -# All rights reserved. This program and the accompanying materials +# The makefile can be invoked with +# ARCH = x86_64 or x64 for EM64T build +# ARCH = ia32 or IA32 for IA32 build +# ARCH = ia64 or IA64 for IA64 build +# ARCH = Arm or ARM for ARM build +# +# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at # http://opensource.org/licenses/bsd-license.php # # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -ARCH ?= IA32 - -CYGWIN:=$(findstring CYGWIN, $(shell uname -s)) -LINUX:=$(findstring Linux, $(shell uname -s)) -DARWIN:=$(findstring Darwin, $(shell uname -s)) - -CC = gcc -CXX = g++ -AS = gcc -AR = ar -LD = ld -LINKER ?= $(CC) -ifeq ($(ARCH), IA32) -ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/ -endif - -ifeq ($(ARCH), X64) -ARCH_INCLUDE = -I $(MAKEROOT)/Include/X64/ -endif - -INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE) -CPPFLAGS = $(INCLUDE) -CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fno-merge-constants -nostdlib -Wall -Werror -c -g -LFLAGS = - -# -# Snow Leopard is a 32-bit and 64-bit environment. uname -m returns -i386, but gcc defaults -# to x86_64. So make sure tools match uname -m -# -uname_s = $(shell uname -s) -ifeq ($(uname_s),Darwin) - CFLAGS += -arch i386 - CPPFLAGS += -arch i386 - LFLAGS += -arch i386 -endif - -.PHONY: all -.PHONY: install -.PHONY: clean - -all: - -$(MAKEROOT)/libs: - mkdir $(MAKEROOT)/libs - -$(MAKEROOT)/bin: - mkdir $(MAKEROOT)/bin +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +ARCH ?= IA32 + +CYGWIN:=$(findstring CYGWIN, $(shell uname -s)) +LINUX:=$(findstring Linux, $(shell uname -s)) +DARWIN:=$(findstring Darwin, $(shell uname -s)) + +CC = gcc +CXX = g++ +AS = gcc +AR = ar +LD = ld +LINKER ?= $(CC) +ifeq ($(ARCH), IA32) +ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/ +endif + +ifeq ($(ARCH), X64) +ARCH_INCLUDE = -I $(MAKEROOT)/Include/X64/ +endif + +ifeq ($(ARCH), ARM) +ARCH_INCLUDE = -I $(MAKEROOT)/Include/Arm/ +endif + +ifeq ($(ARCH), AARCH64) +ARCH_INCLUDE = -I $(MAKEROOT)/Include/AArch64/ +endif + +INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE) +CPPFLAGS = $(INCLUDE) +ifeq ($(DARWIN),Darwin) +# assume clang or clang compatible flags on OS X +CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -nostdlib -c -g +else +CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -nostdlib -c -g +endif +LFLAGS = + +ifeq ($(ARCH), IA32) +# +# Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults +# to x86_64. So make sure tools match uname -m. You can manual have a 64-bit kernal on Snow Leopard +# so only do this is uname -m returns i386. +# +ifeq ($(DARWIN),Darwin) + CFLAGS += -arch i386 + CPPFLAGS += -arch i386 + LFLAGS += -arch i386 +endif +endif + + +.PHONY: all +.PHONY: install +.PHONY: clean + +all: + +$(MAKEROOT)/libs: + mkdir $(MAKEROOT)/libs + +$(MAKEROOT)/bin: + mkdir $(MAKEROOT)/bin