]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Source/C/GNUmakefile
BaseTools: Add DevicePath support for PCD values
[mirror_edk2.git] / BaseTools / Source / C / GNUmakefile
CommitLineData
f51461c8
LG
1## @file\r
2# GNU/Linux makefile for C tools build.\r
3#\r
9e1131b7 4# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
f51461c8
LG
5#\r
6# This program and the accompanying materials\r
7# are licensed and made available under the terms and conditions of the BSD License\r
8# which accompanies this distribution. The full text of the license may be found at\r
9# http://opensource.org/licenses/bsd-license.php\r
10#\r
11# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13#\r
14\r
a9f6e0a4 15ifndef HOST_ARCH\r
f51461c8 16 #\r
a9f6e0a4
LG
17 # If HOST_ARCH is not defined, then we use 'uname -m' to attempt\r
18 # try to figure out the appropriate HOST_ARCH.\r
f51461c8
LG
19 #\r
20 uname_m = $(shell uname -m)\r
a9f6e0a4 21 $(info Attempting to detect HOST_ARCH from 'uname -m': $(uname_m))\r
e4ac870f 22 ifneq (,$(strip $(filter $(uname_m), x86_64 amd64)))\r
a9f6e0a4 23 HOST_ARCH=X64\r
f51461c8
LG
24 endif\r
25 ifeq ($(patsubst i%86,IA32,$(uname_m)),IA32)\r
a9f6e0a4 26 HOST_ARCH=IA32\r
f51461c8 27 endif\r
ad2a2e56 28 ifneq (,$(findstring aarch64,$(uname_m)))\r
a9f6e0a4 29 HOST_ARCH=AARCH64\r
ad2a2e56
AB
30 endif\r
31 ifneq (,$(findstring arm,$(uname_m)))\r
a9f6e0a4 32 HOST_ARCH=ARM\r
ad2a2e56 33 endif\r
a9f6e0a4
LG
34 ifndef HOST_ARCH\r
35 $(info Could not detected HOST_ARCH from uname results)\r
36 $(error HOST_ARCH is not defined!)\r
f51461c8 37 endif\r
a9f6e0a4 38 $(info Detected HOST_ARCH of $(HOST_ARCH) using uname.)\r
f51461c8
LG
39endif\r
40\r
a9f6e0a4 41export HOST_ARCH\r
f51461c8
LG
42\r
43MAKEROOT = .\r
44\r
45include Makefiles/header.makefile\r
46\r
9e1131b7 47all: makerootdir subdirs\r
a9f6e0a4 48 @echo Finished building BaseTools C Tools with HOST_ARCH=$(HOST_ARCH)\r
f51461c8
LG
49\r
50LIBRARIES = Common\r
9e1131b7 51VFRAUTOGEN = VfrCompile/VfrLexer.h\r
f51461c8
LG
52# NON_BUILDABLE_APPLICATIONS = GenBootSector BootSectImage\r
53APPLICATIONS = \\r
81fa5ad0
LG
54 BrotliCompress \\r
55 VfrCompile \\r
f51461c8
LG
56 GnuGenBootSector \\r
57 BootSectImage \\r
58 EfiLdrImage \\r
59 EfiRom \\r
60 GenFfs \\r
61 GenFv \\r
62 GenFw \\r
63 GenPage \\r
64 GenSec \\r
65 GenCrc32 \\r
66 GenVtf \\r
67 LzmaCompress \\r
68 Split \\r
69 TianoCompress \\r
7dbc50bd
YZ
70 VolInfo \\r
71 DevicePath\r
f51461c8
LG
72\r
73SUBDIRS := $(LIBRARIES) $(APPLICATIONS)\r
74\r
9e1131b7
LG
75$(LIBRARIES): $(MAKEROOT)/libs\r
76$(APPLICATIONS): $(LIBRARIES) $(MAKEROOT)/bin $(VFRAUTOGEN)\r
77\r
f51461c8
LG
78.PHONY: outputdirs\r
79makerootdir:\r
80 -mkdir -p $(MAKEROOT)\r
81\r
82.PHONY: subdirs $(SUBDIRS)\r
83subdirs: $(SUBDIRS)\r
84$(SUBDIRS):\r
85 $(MAKE) -C $@\r
86\r
87.PHONY: $(patsubst %,%-clean,$(sort $(SUBDIRS)))\r
88$(patsubst %,%-clean,$(sort $(SUBDIRS))):\r
89 -$(MAKE) -C $(@:-clean=) clean\r
90\r
9e1131b7
LG
91$(VFRAUTOGEN): VfrCompile/VfrSyntax.g \r
92 $(MAKE) -C VfrCompile VfrLexer.h\r
93\r
f51461c8
LG
94clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))\r
95\r
96clean: localClean\r
97\r
98localClean:\r
99 rm -f $(MAKEROOT)/bin/*\r
100 -rmdir $(MAKEROOT)/libs $(MAKEROOT)/bin\r
101\r
102include Makefiles/footer.makefile\r