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