]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Source/C/GNUmakefile
StandaloneMmPkg: Fix ECC error 4002 in StandaloneMmCpu
[mirror_edk2.git] / BaseTools / Source / C / GNUmakefile
CommitLineData
f51461c8
LG
1## @file\r
2# GNU/Linux makefile for C tools build.\r
3#\r
064daac0 4# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
f51461c8 5#\r
2e351cbe 6# SPDX-License-Identifier: BSD-2-Clause-Patent\r
f51461c8
LG
7#\r
8\r
a9f6e0a4 9ifndef HOST_ARCH\r
f51461c8 10 #\r
a9f6e0a4
LG
11 # If HOST_ARCH is not defined, then we use 'uname -m' to attempt\r
12 # try to figure out the appropriate HOST_ARCH.\r
f51461c8
LG
13 #\r
14 uname_m = $(shell uname -m)\r
a9f6e0a4 15 $(info Attempting to detect HOST_ARCH from 'uname -m': $(uname_m))\r
e4ac870f 16 ifneq (,$(strip $(filter $(uname_m), x86_64 amd64)))\r
a9f6e0a4 17 HOST_ARCH=X64\r
f51461c8
LG
18 endif\r
19 ifeq ($(patsubst i%86,IA32,$(uname_m)),IA32)\r
a9f6e0a4 20 HOST_ARCH=IA32\r
f51461c8 21 endif\r
ad2a2e56 22 ifneq (,$(findstring aarch64,$(uname_m)))\r
a9f6e0a4 23 HOST_ARCH=AARCH64\r
fbb0ec7e
RC
24 else ifneq (,$(findstring arm64,$(uname_m)))\r
25 HOST_ARCH=AARCH64\r
26 else ifneq (,$(findstring arm,$(uname_m)))\r
a9f6e0a4 27 HOST_ARCH=ARM\r
ad2a2e56 28 endif\r
ffa51b3b
N
29 ifneq (,$(findstring riscv64,$(uname_m)))\r
30 HOST_ARCH=RISCV64\r
31 endif\r
a9f6e0a4
LG
32 ifndef HOST_ARCH\r
33 $(info Could not detected HOST_ARCH from uname results)\r
34 $(error HOST_ARCH is not defined!)\r
f51461c8 35 endif\r
a9f6e0a4 36 $(info Detected HOST_ARCH of $(HOST_ARCH) using uname.)\r
f51461c8
LG
37endif\r
38\r
a9f6e0a4 39export HOST_ARCH\r
f51461c8
LG
40\r
41MAKEROOT = .\r
42\r
43include Makefiles/header.makefile\r
44\r
9e1131b7 45all: makerootdir subdirs\r
a9f6e0a4 46 @echo Finished building BaseTools C Tools with HOST_ARCH=$(HOST_ARCH)\r
f51461c8
LG
47\r
48LIBRARIES = Common\r
9e1131b7 49VFRAUTOGEN = VfrCompile/VfrLexer.h\r
f51461c8 50APPLICATIONS = \\r
81fa5ad0
LG
51 BrotliCompress \\r
52 VfrCompile \\r
f51461c8
LG
53 EfiRom \\r
54 GenFfs \\r
55 GenFv \\r
56 GenFw \\r
f51461c8
LG
57 GenSec \\r
58 GenCrc32 \\r
f51461c8
LG
59 LzmaCompress \\r
60 Split \\r
61 TianoCompress \\r
7dbc50bd
YZ
62 VolInfo \\r
63 DevicePath\r
f51461c8
LG
64\r
65SUBDIRS := $(LIBRARIES) $(APPLICATIONS)\r
66\r
9e1131b7
LG
67$(LIBRARIES): $(MAKEROOT)/libs\r
68$(APPLICATIONS): $(LIBRARIES) $(MAKEROOT)/bin $(VFRAUTOGEN)\r
69\r
f51461c8
LG
70.PHONY: outputdirs\r
71makerootdir:\r
72 -mkdir -p $(MAKEROOT)\r
73\r
74.PHONY: subdirs $(SUBDIRS)\r
75subdirs: $(SUBDIRS)\r
76$(SUBDIRS):\r
77 $(MAKE) -C $@\r
78\r
79.PHONY: $(patsubst %,%-clean,$(sort $(SUBDIRS)))\r
80$(patsubst %,%-clean,$(sort $(SUBDIRS))):\r
81 -$(MAKE) -C $(@:-clean=) clean\r
82\r
0deca401 83$(VFRAUTOGEN): VfrCompile/VfrSyntax.g\r
9e1131b7
LG
84 $(MAKE) -C VfrCompile VfrLexer.h\r
85\r
f51461c8
LG
86clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))\r
87\r
88clean: localClean\r
89\r
90localClean:\r
91 rm -f $(MAKEROOT)/bin/*\r
92 -rmdir $(MAKEROOT)/libs $(MAKEROOT)/bin\r
93\r
94include Makefiles/footer.makefile\r