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)))
25 ifneq (,$(findstring arm,$(uname_m)))
29 $(info Could not detected HOST_ARCH from uname results)
30 $(error HOST_ARCH is not defined!)
32 $(info Detected HOST_ARCH of $(HOST_ARCH) using uname.)
39 include Makefiles/header.makefile
41 all: makerootdir subdirs
42 @echo Finished building BaseTools C Tools with HOST_ARCH=$(HOST_ARCH)
45 VFRAUTOGEN = VfrCompile/VfrLexer.h
61 SUBDIRS := $(LIBRARIES) $(APPLICATIONS)
63 $(LIBRARIES): $(MAKEROOT)/libs
64 $(APPLICATIONS): $(LIBRARIES) $(MAKEROOT)/bin $(VFRAUTOGEN)
70 .PHONY: subdirs $(SUBDIRS)
75 .PHONY: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
76 $(patsubst %,%-clean,$(sort $(SUBDIRS))):
77 -$(MAKE) -C $(@:-clean=) clean
79 $(VFRAUTOGEN): VfrCompile/VfrSyntax.g
80 $(MAKE) -C VfrCompile VfrLexer.h
82 clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
87 rm -f $(MAKEROOT)/bin/*
88 -rmdir $(MAKEROOT)/libs $(MAKEROOT)/bin
90 include Makefiles/footer.makefile