• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 - 2010, 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
24CC ?= gcc
25CXX ?= g++
26AS ?= gcc
27AR ?= ar
28LD ?= ld
29LINKER ?= $(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)
47CPPFLAGS = $(INCLUDE)
48ifeq ($(DARWIN),Darwin)
49# assume clang or clang compatible flags on OS X
50CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -nostdlib -c -g
51else
52CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -nostdlib -c -g
53endif
54LFLAGS =
55
56ifeq ($(ARCH), IA32)
57#
58# Snow Leopard  is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults
59#  to x86_64. So make sure tools match uname -m. You can manual have a 64-bit kernal on Snow Leopard
60#  so only do this is uname -m returns i386.
61#
62ifeq ($(DARWIN),Darwin)
63  CFLAGS   += -arch i386
64  CPPFLAGS += -arch i386
65  LFLAGS   += -arch i386
66endif
67endif
68
69
70.PHONY: all
71.PHONY: install
72.PHONY: clean
73
74all:
75
76$(MAKEROOT)/libs:
77	mkdir $(MAKEROOT)/libs
78
79$(MAKEROOT)/bin:
80	mkdir $(MAKEROOT)/bin
81