1## @file 2# 3# The makefile can be invoked with 4# ARCH = x86_64 or x64 for EM64T build 5# ARCH = ia32 or IA32 for IA32 build 6# ARCH = ia64 or IA64 for IA64 build 7# ARCH = Arm or ARM for ARM build 8# 9# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR> 10# This program and the accompanying materials 11# are licensed and made available under the terms and conditions of the BSD License 12# which accompanies this distribution. The full text of the license may be found at 13# http://opensource.org/licenses/bsd-license.php 14# 15# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 16# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 17 18ARCH ?= IA32 19 20CYGWIN:=$(findstring CYGWIN, $(shell uname -s)) 21LINUX:=$(findstring Linux, $(shell uname -s)) 22DARWIN:=$(findstring Darwin, $(shell uname -s)) 23 24BUILD_CC ?= gcc 25BUILD_CXX ?= g++ 26BUILD_AS ?= gcc 27BUILD_AR ?= ar 28BUILD_LD ?= ld 29LINKER ?= $(BUILD_CC) 30ifeq ($(ARCH), IA32) 31ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/ 32endif 33 34ifeq ($(ARCH), X64) 35ARCH_INCLUDE = -I $(MAKEROOT)/Include/X64/ 36endif 37 38ifeq ($(ARCH), ARM) 39ARCH_INCLUDE = -I $(MAKEROOT)/Include/Arm/ 40endif 41 42ifeq ($(ARCH), AARCH64) 43ARCH_INCLUDE = -I $(MAKEROOT)/Include/AArch64/ 44endif 45 46INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE) 47BUILD_CPPFLAGS = $(INCLUDE) -O2 48ifeq ($(DARWIN),Darwin) 49# assume clang or clang compatible flags on OS X 50BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -c -g 51else 52BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g 53endif 54BUILD_LFLAGS = 55BUILD_CXXFLAGS = -Wno-unused-result 56 57ifeq ($(ARCH), IA32) 58# 59# Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults 60# to x86_64. So make sure tools match uname -m. You can manual have a 64-bit kernal on Snow Leopard 61# so only do this is uname -m returns i386. 62# 63ifeq ($(DARWIN),Darwin) 64 BUILD_CFLAGS += -arch i386 65 BUILD_CPPFLAGS += -arch i386 66 BUILD_LFLAGS += -arch i386 67endif 68endif 69 70 71.PHONY: all 72.PHONY: install 73.PHONY: clean 74 75all: 76 77$(MAKEROOT)/libs: 78 mkdir $(MAKEROOT)/libs 79 80$(MAKEROOT)/bin: 81 mkdir $(MAKEROOT)/bin 82