bout_runners.utils.names

Module containing functions to extract names.

Functions

get_exec_name(makefile_path)

Return the name of the project executable.

get_makefile_name(makefile_root_path)

Search for a valid Makefile.

get_makefile_path(makefile_root_path, …)

Return the makefile path.

bout_runners.utils.names.get_exec_name(makefile_path: pathlib.Path) → str[source]

Return the name of the project executable.

This method first searches for the ‘TARGET’ variable in the makefile. If not found it infers the name from the ‘SOURCEC’ variable.

Parameters
makefile_pathPath or str

Path to the make file

Returns
exec_namestr

Name of the executable

bout_runners.utils.names.get_makefile_name(makefile_root_path: pathlib.Path) → str[source]

Search for a valid Makefile.

The order of the search is ‘GNUmakefile’, ‘makefile’ and ‘Makefile’

Parameters
makefile_root_pathPath

Path to the root directory of the Makefile

Returns
makefile_namestr

The name of the Makefile

Raises
FileNotFoundError

If none of the valid makefile names are found

bout_runners.utils.names.get_makefile_path(makefile_root_path: pathlib.Path, makefile_name: Optional[str]) → pathlib.Path[source]

Return the makefile path.

Parameters
makefile_root_pathPath or str

Root path of make file

makefile_nameNone or str

The name of the makefile. If set to None, it tries the following names, in order: ‘GNUmakefile’, ‘makefile’ and ‘Makefile’

Returns
makefile_pathPath

Path to the makefile