]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/Makefiles/header.makefile
Sync BaseTool trunk (version r2599) into EDKII BaseTools.
[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 INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE)
43 CPPFLAGS = $(INCLUDE)
44 CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fno-merge-constants -nostdlib -Wall -Werror -c -g
45 LFLAGS =
46
47 ifeq ($(ARCH), IA32)
48 #
49 # Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults
50 # to x86_64. So make sure tools match uname -m. You can manual have a 64-bit kernal on Snow Leopard
51 # so only do this is uname -m returns i386.
52 #
53 uname_s = $(shell uname -s)
54 ifeq ($(uname_s),Darwin)
55 CFLAGS += -arch i386
56 CPPFLAGS += -arch i386
57 LFLAGS += -arch i386
58 endif
59 endif
60
61
62 .PHONY: all
63 .PHONY: install
64 .PHONY: clean
65
66 all:
67
68 $(MAKEROOT)/libs:
69 mkdir $(MAKEROOT)/libs
70
71 $(MAKEROOT)/bin:
72 mkdir $(MAKEROOT)/bin