]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/Makefiles/header.makefile
Fix build error.
[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 #
43 # Snow Leopard is a 32-bit and 64-bit environment. uname -m returns -i386, but gcc defaults
44 # to x86_64. So make sure tools match uname -m
45 #
46 uname_s = $(shell uname -s)
47 ifeq ($(uname_s),Darwin)
48 CFLAGS += -arch i386
49 CPPFLAGS += -arch i386
50 LFLAGS += -arch i386
51 endif
52
53 .PHONY: all
54 .PHONY: install
55 .PHONY: clean
56
57 all:
58
59 $(MAKEROOT)/libs:
60 mkdir $(MAKEROOT)/libs
61
62 $(MAKEROOT)/bin:
63 mkdir $(MAKEROOT)/bin