2014-01-27 06:23:15 +01:00
|
|
|
## @file
|
|
|
|
# GNU/Linux makefile for C tools build.
|
|
|
|
#
|
2017-11-28 04:18:51 +01:00
|
|
|
# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
|
2014-01-27 06:23:15 +01:00
|
|
|
#
|
|
|
|
# This program and the accompanying materials
|
|
|
|
# are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
# which accompanies this distribution. The full text of the license may be found at
|
|
|
|
# http://opensource.org/licenses/bsd-license.php
|
|
|
|
#
|
|
|
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
#
|
|
|
|
|
2017-11-28 04:18:50 +01:00
|
|
|
ifndef HOST_ARCH
|
2014-01-27 06:23:15 +01:00
|
|
|
#
|
2017-11-28 04:18:50 +01:00
|
|
|
# If HOST_ARCH is not defined, then we use 'uname -m' to attempt
|
|
|
|
# try to figure out the appropriate HOST_ARCH.
|
2014-01-27 06:23:15 +01:00
|
|
|
#
|
|
|
|
uname_m = $(shell uname -m)
|
2017-11-28 04:18:50 +01:00
|
|
|
$(info Attempting to detect HOST_ARCH from 'uname -m': $(uname_m))
|
2014-07-01 09:10:10 +02:00
|
|
|
ifneq (,$(strip $(filter $(uname_m), x86_64 amd64)))
|
2017-11-28 04:18:50 +01:00
|
|
|
HOST_ARCH=X64
|
2014-01-27 06:23:15 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(patsubst i%86,IA32,$(uname_m)),IA32)
|
2017-11-28 04:18:50 +01:00
|
|
|
HOST_ARCH=IA32
|
2014-01-27 06:23:15 +01:00
|
|
|
endif
|
2015-08-12 07:22:49 +02:00
|
|
|
ifneq (,$(findstring aarch64,$(uname_m)))
|
2017-11-28 04:18:50 +01:00
|
|
|
HOST_ARCH=AARCH64
|
2015-08-12 07:22:49 +02:00
|
|
|
endif
|
|
|
|
ifneq (,$(findstring arm,$(uname_m)))
|
2017-11-28 04:18:50 +01:00
|
|
|
HOST_ARCH=ARM
|
2015-08-12 07:22:49 +02:00
|
|
|
endif
|
2017-11-28 04:18:50 +01:00
|
|
|
ifndef HOST_ARCH
|
|
|
|
$(info Could not detected HOST_ARCH from uname results)
|
|
|
|
$(error HOST_ARCH is not defined!)
|
2014-01-27 06:23:15 +01:00
|
|
|
endif
|
2017-11-28 04:18:50 +01:00
|
|
|
$(info Detected HOST_ARCH of $(HOST_ARCH) using uname.)
|
2014-01-27 06:23:15 +01:00
|
|
|
endif
|
|
|
|
|
2017-11-28 04:18:50 +01:00
|
|
|
export HOST_ARCH
|
2014-01-27 06:23:15 +01:00
|
|
|
|
|
|
|
MAKEROOT = .
|
|
|
|
|
|
|
|
include Makefiles/header.makefile
|
|
|
|
|
2017-11-28 04:18:51 +01:00
|
|
|
all: makerootdir subdirs
|
2017-11-28 04:18:50 +01:00
|
|
|
@echo Finished building BaseTools C Tools with HOST_ARCH=$(HOST_ARCH)
|
2014-01-27 06:23:15 +01:00
|
|
|
|
|
|
|
LIBRARIES = Common
|
2017-11-28 04:18:51 +01:00
|
|
|
VFRAUTOGEN = VfrCompile/VfrLexer.h
|
2014-01-27 06:23:15 +01:00
|
|
|
# NON_BUILDABLE_APPLICATIONS = GenBootSector BootSectImage
|
|
|
|
APPLICATIONS = \
|
|
|
|
GnuGenBootSector \
|
|
|
|
BootSectImage \
|
2017-03-23 03:16:16 +01:00
|
|
|
BrotliCompress \
|
2014-01-27 06:23:15 +01:00
|
|
|
EfiLdrImage \
|
|
|
|
EfiRom \
|
|
|
|
GenFfs \
|
|
|
|
GenFv \
|
|
|
|
GenFw \
|
|
|
|
GenPage \
|
|
|
|
GenSec \
|
|
|
|
GenCrc32 \
|
|
|
|
GenVtf \
|
|
|
|
LzmaCompress \
|
|
|
|
Split \
|
|
|
|
TianoCompress \
|
|
|
|
VolInfo \
|
|
|
|
VfrCompile
|
|
|
|
|
|
|
|
SUBDIRS := $(LIBRARIES) $(APPLICATIONS)
|
|
|
|
|
2017-11-28 04:18:51 +01:00
|
|
|
$(LIBRARIES): $(MAKEROOT)/libs
|
|
|
|
$(APPLICATIONS): $(LIBRARIES) $(MAKEROOT)/bin $(VFRAUTOGEN)
|
|
|
|
|
2014-01-27 06:23:15 +01:00
|
|
|
.PHONY: outputdirs
|
|
|
|
makerootdir:
|
|
|
|
-mkdir -p $(MAKEROOT)
|
|
|
|
|
|
|
|
.PHONY: subdirs $(SUBDIRS)
|
|
|
|
subdirs: $(SUBDIRS)
|
|
|
|
$(SUBDIRS):
|
|
|
|
$(MAKE) -C $@
|
|
|
|
|
|
|
|
.PHONY: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
|
|
|
|
$(patsubst %,%-clean,$(sort $(SUBDIRS))):
|
|
|
|
-$(MAKE) -C $(@:-clean=) clean
|
|
|
|
|
2017-11-28 04:18:51 +01:00
|
|
|
$(VFRAUTOGEN): VfrCompile/VfrSyntax.g
|
|
|
|
$(MAKE) -C VfrCompile VfrLexer.h
|
|
|
|
|
2014-01-27 06:23:15 +01:00
|
|
|
clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
|
|
|
|
|
|
|
|
clean: localClean
|
|
|
|
|
|
|
|
localClean:
|
|
|
|
rm -f $(MAKEROOT)/bin/*
|
|
|
|
-rmdir $(MAKEROOT)/libs $(MAKEROOT)/bin
|
|
|
|
|
|
|
|
include Makefiles/footer.makefile
|