]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Source/C/GNUmakefile
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[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
114e6075
CL
32 ifneq (,$(findstring loongarch64,$(uname_m)))\r
33 HOST_ARCH=LOONGARCH64\r
34 endif\r
a9f6e0a4
LG
35 ifndef HOST_ARCH\r
36 $(info Could not detected HOST_ARCH from uname results)\r
37 $(error HOST_ARCH is not defined!)\r
f51461c8 38 endif\r
a9f6e0a4 39 $(info Detected HOST_ARCH of $(HOST_ARCH) using uname.)\r
f51461c8
LG
40endif\r
41\r
a9f6e0a4 42export HOST_ARCH\r
f51461c8
LG
43\r
44MAKEROOT = .\r
45\r
46include Makefiles/header.makefile\r
47\r
9e1131b7 48all: makerootdir subdirs\r
a9f6e0a4 49 @echo Finished building BaseTools C Tools with HOST_ARCH=$(HOST_ARCH)\r
f51461c8
LG
50\r
51LIBRARIES = Common\r
9e1131b7 52VFRAUTOGEN = VfrCompile/VfrLexer.h\r
f51461c8 53APPLICATIONS = \\r
81fa5ad0
LG
54 BrotliCompress \\r
55 VfrCompile \\r
f51461c8
LG
56 EfiRom \\r
57 GenFfs \\r
58 GenFv \\r
59 GenFw \\r
f51461c8
LG
60 GenSec \\r
61 GenCrc32 \\r
f51461c8 62 LzmaCompress \\r
f51461c8 63 TianoCompress \\r
7dbc50bd
YZ
64 VolInfo \\r
65 DevicePath\r
f51461c8
LG
66\r
67SUBDIRS := $(LIBRARIES) $(APPLICATIONS)\r
68\r
9e1131b7
LG
69$(LIBRARIES): $(MAKEROOT)/libs\r
70$(APPLICATIONS): $(LIBRARIES) $(MAKEROOT)/bin $(VFRAUTOGEN)\r
71\r
f51461c8
LG
72.PHONY: outputdirs\r
73makerootdir:\r
74 -mkdir -p $(MAKEROOT)\r
75\r
76.PHONY: subdirs $(SUBDIRS)\r
77subdirs: $(SUBDIRS)\r
78$(SUBDIRS):\r
79 $(MAKE) -C $@\r
80\r
81.PHONY: $(patsubst %,%-clean,$(sort $(SUBDIRS)))\r
82$(patsubst %,%-clean,$(sort $(SUBDIRS))):\r
83 -$(MAKE) -C $(@:-clean=) clean\r
84\r
0deca401 85$(VFRAUTOGEN): VfrCompile/VfrSyntax.g\r
9e1131b7
LG
86 $(MAKE) -C VfrCompile VfrLexer.h\r
87\r
f51461c8
LG
88clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))\r
89\r
90clean: localClean\r
91\r
92localClean:\r
93 rm -f $(MAKEROOT)/bin/*\r
94 -rmdir $(MAKEROOT)/libs $(MAKEROOT)/bin\r
95\r
96include Makefiles/footer.makefile\r