audk/BaseTools/Source/Python
Rebecca Cran 206168e83f BaseTools: Allow users to specify compiler to use with make CC= CXX=
In https://bugzilla.tianocore.org/show_bug.cgi?id=2842 clang support was
added by having users specify "make CXX=llvm" when building BaseTools.

The Makefile then sees that and sets CC=$(CLANG_BIN)clang and
CXX=$(CLANG_BIN)clang++. That requires that the executables 'clang' and
'clang++' exist and for example aren't named 'clang-17' and
'clang++-17'. Also, it's an unusual way of specifying the compiler,
since many users will expect to be able to override CC and CXX on the
make command line.

Rework the BaseTools Makefiles removing the 'BUILD_' prefix (BUILD_CC
and BUILD_CXX) and using the standard name 'LDFLAGS' instead of
'LFLAGS'. This allows clang to be used by running
'make -C BaseTools CC=clang CXX=clang++'.

Signed-off-by: Rebecca Cran <rebecca@quicinc.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2023-04-05 15:44:48 +00:00
..
AmlToC
AutoGen
BPDG
Capsule
Common BaseTools: Add missing spaces for PCD expression values in AutoGenC 2022-10-19 06:32:07 +00:00
CommonDataClass BaseTools: Add support for SUBTYPE_GUID section generation 2022-10-19 06:32:07 +00:00
Ecc BaseTools: Remove duplicated words in Python tools 2022-10-19 06:32:07 +00:00
Eot
FMMT BaseTools/FMMT: Add Shrink Fv function 2022-10-19 06:32:07 +00:00
FirmwareStorageFormat
GenFds BaseTools/GenFds: Correct file type set for the PIC section 2022-10-19 06:32:07 +00:00
GenPatchPcdTable
PatchPcdValue
Pkcs7Sign
Rsa2048Sha256Sign
Split
Table
TargetTool
Trim
UPT
Workspace BaseTools: Allow users to specify compiler to use with make CC= CXX= 2023-04-05 15:44:48 +00:00
build BaseTools: Extend fields for module_report.json 2023-03-11 06:21:49 +00:00
tests/Split
GNUmakefile
Makefile
README.md
basetool_tiano_python_path_env.yaml
sitecustomize.py

README.md

Edk2 Basetools

This folder has traditionally held the source of Python based tools used by EDK2. The official repo this source has moved to https://github.com/tianocore/edk2-basetools. This folder will remain in the tree until the next stable release (expected 202102). There is a new folder under Basetools BinPipWrappers that uses the pip module rather than this tree for Basetools. By adding the scope pipbuild-win or pipbuild-unix (depending on your host system), the SDE will use the BinPipWrappers instead of the regular BinWrappers.

Why Move It?

The discussion is on the mailing list. The RFC is here: https://edk2.groups.io/g/rfc/topic/74009714#270 The benefits allow for the Basetools project to be used separately from EDK2 itself as well as offering it in a globally accessible manner. This makes it much easier to build a module using Basetools. Separating the Basetools into their own repo allows for easier CI and contribution process. Additional pros, cons, and process can be found on the mailing list.

How Do I Install It?

By default, EDK2 is tied to and tested with a specific version of the Basetools through pip-requirements.txt. You can simply run:

pip install -r pip-requirements.txt

This will install the required module, thought we strongly suggest setting up a virtual environment. Additionally, you can also install a local clone of the Basetools as well as a specific git commit.