2 # GNU/Linux makefile for C tools build.
4 # Copyright (c) 2007 - 2017, 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
62 SUBDIRS := $(LIBRARIES) $(APPLICATIONS)
64 $(LIBRARIES): $(MAKEROOT)/libs
65 $(APPLICATIONS): $(LIBRARIES) $(MAKEROOT)/bin $(VFRAUTOGEN)
71 .PHONY: subdirs $(SUBDIRS)
76 .PHONY: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
77 $(patsubst %,%-clean,$(sort $(SUBDIRS))):
78 -$(MAKE) -C $(@:-clean=) clean
80 $(VFRAUTOGEN): VfrCompile/VfrSyntax.g
81 $(MAKE) -C VfrCompile VfrLexer.h
83 clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
88 rm -f $(MAKEROOT)/bin/*
89 -rmdir $(MAKEROOT)/libs $(MAKEROOT)/bin
91 include Makefiles/footer.makefile