]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/Makefiles/header.makefile
BaseTools: Actually plug in BaseTools build on AArch64
[mirror_edk2.git] / BaseTools / Source / C / Makefiles / header.makefile
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
18 ARCH ?= IA32
19
20 CYGWIN:=$(findstring CYGWIN, $(shell uname -s))
21 LINUX:=$(findstring Linux, $(shell uname -s))
22 DARWIN:=$(findstring Darwin, $(shell uname -s))
23
24 CC = gcc
25 CXX = g++
26 AS = gcc
27 AR = ar
28 LD = ld
29 LINKER ?= $(CC)
30 ifeq ($(ARCH), IA32)
31 ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/
32 endif
33
34 ifeq ($(ARCH), X64)
35 ARCH_INCLUDE = -I $(MAKEROOT)/Include/X64/
36 endif
37
38 ifeq ($(ARCH), ARM)
39 ARCH_INCLUDE = -I $(MAKEROOT)/Include/Arm/
40 endif
41
42 ifeq ($(ARCH), AARCH64)
43 ARCH_INCLUDE = -I $(MAKEROOT)/Include/AArch64/
44 endif
45
46 INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE)
47 CPPFLAGS = $(INCLUDE)
48 ifeq ($(DARWIN),Darwin)
49 # assume clang or clang compatible flags on OS X
50 CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -nostdlib -c -g
51 else
52 CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -nostdlib -c -g
53 endif
54 LFLAGS =
55
56 ifeq ($(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 #
62 ifeq ($(DARWIN),Darwin)
63 CFLAGS += -arch i386
64 CPPFLAGS += -arch i386
65 LFLAGS += -arch i386
66 endif
67 endif
68
69
70 .PHONY: all
71 .PHONY: install
72 .PHONY: clean
73
74 all:
75
76 $(MAKEROOT)/libs:
77 mkdir $(MAKEROOT)/libs
78
79 $(MAKEROOT)/bin:
80 mkdir $(MAKEROOT)/bin