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