2 # GNU/Linux makefile for C tools build.
4 # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
6 # SPDX-License-Identifier: BSD-2-Clause-Patent
11 # If HOST_ARCH is not defined, then we use 'uname -m' to attempt
12 # try to figure out the appropriate HOST_ARCH.
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)))
19 ifeq ($(patsubst i%86,IA32,$(uname_m)),IA32)
22 ifneq (,$(findstring aarch64,$(uname_m)))
24 else ifneq (,$(findstring arm64,$(uname_m)))
26 else ifneq (,$(findstring arm,$(uname_m)))
30 $(info Could not detected HOST_ARCH from uname results)
31 $(error HOST_ARCH is not defined!)
33 $(info Detected HOST_ARCH of $(HOST_ARCH) using uname.)
40 include Makefiles/header.makefile
42 all: makerootdir subdirs
43 @echo Finished building BaseTools C Tools with HOST_ARCH=$(HOST_ARCH)
46 VFRAUTOGEN = VfrCompile/VfrLexer.h
65 SUBDIRS := $(LIBRARIES) $(APPLICATIONS)
67 $(LIBRARIES): $(MAKEROOT)/libs
68 $(APPLICATIONS): $(LIBRARIES) $(MAKEROOT)/bin $(VFRAUTOGEN)
74 .PHONY: subdirs $(SUBDIRS)
79 .PHONY: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
80 $(patsubst %,%-clean,$(sort $(SUBDIRS))):
81 -$(MAKE) -C $(@:-clean=) clean
83 $(VFRAUTOGEN): VfrCompile/VfrSyntax.g
84 $(MAKE) -C VfrCompile VfrLexer.h
86 clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
91 rm -f $(MAKEROOT)/bin/*
92 -rmdir $(MAKEROOT)/libs $(MAKEROOT)/bin
94 include Makefiles/footer.makefile