2 # GNU/Linux makefile for C tools build.
4 # Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
6 # This program and the accompanying materials
7 # are licensed and made available under the terms and conditions of the BSD License
8 # which accompanies this distribution. The full text of the license may be found at
9 # http://opensource.org/licenses/bsd-license.php
11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 # If HOST_ARCH is not defined, then we use 'uname -m' to attempt
18 # try to figure out the appropriate HOST_ARCH.
20 uname_m = $(shell uname -m)
21 $(info Attempting to detect HOST_ARCH from 'uname -m': $(uname_m))
22 ifneq (,$(strip $(filter $(uname_m), x86_64 amd64)))
25 ifeq ($(patsubst i%86,IA32,$(uname_m)),IA32)
28 ifneq (,$(findstring aarch64,$(uname_m)))
31 ifneq (,$(findstring arm,$(uname_m)))
35 $(info Could not detected HOST_ARCH from uname results)
36 $(error HOST_ARCH is not defined!)
38 $(info Detected HOST_ARCH of $(HOST_ARCH) using uname.)
45 include Makefiles/header.makefile
47 all: makerootdir subdirs
48 @echo Finished building BaseTools C Tools with HOST_ARCH=$(HOST_ARCH)
51 VFRAUTOGEN = VfrCompile/VfrLexer.h
52 # NON_BUILDABLE_APPLICATIONS = GenBootSector BootSectImage
73 SUBDIRS := $(LIBRARIES) $(APPLICATIONS)
75 $(LIBRARIES): $(MAKEROOT)/libs
76 $(APPLICATIONS): $(LIBRARIES) $(MAKEROOT)/bin $(VFRAUTOGEN)
82 .PHONY: subdirs $(SUBDIRS)
87 .PHONY: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
88 $(patsubst %,%-clean,$(sort $(SUBDIRS))):
89 -$(MAKE) -C $(@:-clean=) clean
91 $(VFRAUTOGEN): VfrCompile/VfrSyntax.g
92 $(MAKE) -C VfrCompile VfrLexer.h
94 clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
99 rm -f $(MAKEROOT)/bin/*
100 -rmdir $(MAKEROOT)/libs $(MAKEROOT)/bin
102 include Makefiles/footer.makefile