]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/Makefiles/header.makefile
Sync EDKII BaseTools to BaseTools project r2093.
[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 #
8 # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
9 # This program and the accompanying materials
10 # are licensed and made available under the terms and conditions of the BSD License
11 # which accompanies this distribution. The full text of the license may be found at
12 # http://opensource.org/licenses/bsd-license.php
13 #
14 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16
17 ARCH ?= IA32
18
19 CYGWIN:=$(findstring CYGWIN, $(shell uname -s))
20 LINUX:=$(findstring Linux, $(shell uname -s))
21 DARWIN:=$(findstring Darwin, $(shell uname -s))
22
23 CC = gcc
24 CXX = g++
25 AS = gcc
26 AR = ar
27 LD = ld
28 LINKER ?= $(CC)
29 ifeq ($(ARCH), IA32)
30 ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/
31 endif
32
33 ifeq ($(ARCH), X64)
34 ARCH_INCLUDE = -I $(MAKEROOT)/Include/X64/
35 endif
36
37 INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE)
38 CPPFLAGS = $(INCLUDE)
39 CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fno-merge-constants -nostdlib -Wall -Werror -c -g
40 LFLAGS =
41
42 ifeq ($(ARCH), IA32)
43 #
44 # Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults
45 # to x86_64. So make sure tools match uname -m. You can manual have a 64-bit kernal on Snow Leopard
46 # so only do this is uname -m returns i386.
47 #
48 uname_s = $(shell uname -s)
49 ifeq ($(uname_s),Darwin)
50 CFLAGS += -arch i386
51 CPPFLAGS += -arch i386
52 LFLAGS += -arch i386
53 endif
54 endif
55
56
57 .PHONY: all
58 .PHONY: install
59 .PHONY: clean
60
61 all:
62
63 $(MAKEROOT)/libs:
64 mkdir $(MAKEROOT)/libs
65
66 $(MAKEROOT)/bin:
67 mkdir $(MAKEROOT)/bin