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