Functionsο
Dispatchersο
makeprojects.buildο
- makeprojects.build(working_directory=None, args=None)ο
Invoke the buildme command line from within Python.
See also
makeprojects.buildme
- Parameters:
working_directory β
Nonefor current working directory.args β Argument list to pass to the command, None uses sys.argv.
- Returns:
Zero on success, system error code on failure
makeprojects.cleanο
- makeprojects.clean(working_directory=None, args=None)ο
Invoke the cleanme command line from within Python.
See also
makeprojects.cleanme
- Parameters:
working_directory β
Nonefor current working directory.args β Argument list to pass to the command, None uses sys.argv
- Returns:
Zero on success, system error code on failure
makeprojects.rebuildο
- makeprojects.rebuild(working_directory=None, args=None)ο
Invoke the rebuildme command line from within Python.
See also
makeprojects.rebuildme
See also
- Parameters:
working_directory β Directory to rebuild
args β Command line to use instead of sys.argv
- Returns:
Zero on no error, non-zero on error
Generatorsο
makeprojects.new_solutionο
- makeprojects.new_solution(name=None, platform=None, project_type=None)ο
Create a new instance of a full solution.
Convenience routine to create a Solution with a Project and three configurations βDebugβ, βReleaseβ, βInternalβ
See also
core.Solution
- Parameters:
name β Name of the project
platform β Platform for the project
project_type β Type of project
- Returns:
None, a fully stocked Solution
makeprojects.new_configurationο
- makeprojects.new_configuration(configuration_list)ο
Create a new instance of a core.Configuration.
Convenience routine to create a core.Configuration instance.
See also
core.Configuration
- Parameters:
configuration_list β Array of dict() records to describe configurations
- Returns:
None, a single Configuration or a list of valid Configuration records.
Configurationο
config.save_defaultο
- makeprojects.config.save_default(working_directory=None, destinationfile=BUILD_RULES_PY)ο
Calls the internal function to save a default .projectsrc file.
Given a pathname, create and write out a default .projectsrc file that can be used as input to makeprojects to generate project files.
- Parameters:
working_directory β Directory to save the destination file
destinationfile β Pathname of where to save the default configuation file
- Returns:
0 if no error, an error code if the file couldnβt be saved.
config.find_default_build_rulesο
- makeprojects.config.find_default_build_rules()ο
Search for the build_rules.py file.
Scan for the build_rules.py file starting from the current working directory and search downwards until the root directoy is it. If not found, search in the userβs home directory or for linux/macOS, in /etc
- Returns:
Pathname of the configuration file, or None if no file was found.
Cleanο
cleanme.create_parserο
- makeprojects.cleanme.create_parser()ο
Create the parser to process the command line for buildme.
The returned object has these member variables
version boolean if version is requested
recursive boolean for directory recursion
verbose boolean for verbose output
preview boolean for previewing the clean process
generate_build_rules boolean create build rules and exit
rules_file string override build_rules.py
fatal boolean abort if error occurs in processing
directories string array of directories to process
files string array of project files to process
configurations string array of configurations to process
args string array of unknown parameters
- Returns:
argparse.ArgumentParser() object
cleanme.add_clean_rulesο
- makeprojects.cleanme.add_clean_rules(projects, working_directory, file_name, args, build_rules=None)ο
Add a build_rules.py to the clean list.
Given a build_rules.py to parse, check for the function βcleanβ and use that for scanning for functions to call.
All valid entries will be appended to the projects list.
See also
- Parameters:
projects β List of projects to clean.
working_directory β Directory to perform actions on
file_name β Pathname to the build_rules.py file.
args β Args for determining verbosity for output.
build_rules β Preloaded build_rules.py object.
cleanme.add_projectο
- makeprojects.cleanme.add_project(projects, processed, file_name, args)ο
Detect the project type and add it to the list.
- Parameters:
projects β List of projects to build.
processed β List of directories already processed.
file_name β Pathname to the build_rules.py file.
args β Args for determining verbosity for output.
- Returns:
True if the file was buildable, False if not.
cleanme.process_projectsο
- makeprojects.cleanme.process_projects(results, projects, args)ο
Process a list of projects.
Sort the projects by priority and build all of them.
cleanme.process_filesο
- makeprojects.cleanme.process_files(results, processed, files, args)ο
Process a list of files.
cleanme.process_directoriesο
- makeprojects.cleanme.process_directories(results, processed, directories, args)ο
Process a list of directories.
- Parameters:
results β list object to append BuildError objects
processed β List of directories already processed.
directories β iterable list of directories to process
args β parsed argument list for verbosity
- Returns:
True if processing should abort, False if not.
cleanme.process_dependenciesο
- makeprojects.cleanme.process_dependencies(results, processed, dependencies, args)ο
Process a mixed string list of both directories and files.
Iterate over the dependencies list and test each object if itβs a directory, and if so, dispatch to the directory handler, otherwise, process as a file.
- Parameters:
results β list object to append BuildError objects
processed β List of directories already processed.
dependencies β iterable list of files/directories to process
args β parsed argument list for verbosity
- Returns:
True if processing should abort, False if not.
cleanme.mainο
- makeprojects.cleanme.main(working_directory=None, args=None)ο
Command line shell for
cleanme.Entry point for the program
cleanme, this function will either get the parameters from sys.argv or the paramaterargs.--version, show version.-r, Perform a recursive clean.-v, Verbose output.-n, Preview clean commands--generate-rules, Create build_rules.py and exit.--rules-file, Override the configruration file.-q, Quit after the first error-f, List of files to build.-d, List of directories to clean.-c, List of configurations to buildAdditional terms are considered specific files or configurations to clean.
- Parameters:
working_directory β Directory to operate on, or None for os.getcwd()
args β Command line to use instead of sys.argv
- Returns:
Zero on no error, non-zero on error
Buildο
buildme.create_parserο
- makeprojects.buildme.create_parser()ο
Create the parser to process the command line for buildme.
The returned object has these member variables
version boolean if version is requested
recursive boolean for directory recursion
verbose boolean for verbose output
preview boolean for previewing the build process
generate_build_rules boolean create build rules and exit
rules_file string override build_rules.py
fatal boolean abort if error occurs in processing
directories string array of directories to process
files string array of project files to process
configurations string array of configurations to process
documentation boolean if Doxygen is be executed
args string array of unknown parameters
- Returns:
argparse.ArgumentParser() object
buildme.add_build_rulesο
- makeprojects.buildme.add_build_rules(projects, file_name, args, build_rules=None)ο
Add a build_rules.py to the build list.
Given a build_rules.py to parse, check it for a BUILD_LIST and use that for scanning for functions to call. If BUILD_LIST doesnβt exist, use makeprojects.python.BUILD_LIST instead.
All valid entries will be appended to the projects list.
See also
- Parameters:
projects β List of projects to build.
file_name β Pathname to the build_rules.py file.
args β Args for determining verbosity for output.
build_rules β Preloaded build_rules.py object.
buildme.add_projectο
- makeprojects.buildme.add_project(projects, processed, file_name, args)ο
Detect the project type and add it to the list.
- Parameters:
projects β List of projects to build.
processed β List of directories already processed.
file_name β Pathname to the build_rules.py file.
args β Args for determining verbosity for output.
- Returns:
True if the file was buildable, False if not.
buildme.process_projectsο
- makeprojects.buildme.process_projects(results, projects, args)ο
Process a list of projects.
Sort the projects by priority and build all of them.
buildme.process_filesο
- makeprojects.buildme.process_files(results, processed, files, args)ο
Process a list of files.
buildme.process_directoriesο
- makeprojects.buildme.process_directories(results, processed, directories, args)ο
Process a list of directories.
- Parameters:
results β list object to append BuildError objects
processed β List of directories already processed.
directories β iterable list of directories to process
args β parsed argument list for verbosity
- Returns:
True if processing should abort, False if not.
buildme.process_dependenciesο
- makeprojects.buildme.process_dependencies(results, processed, dependencies, args)ο
Process a mixed string list of both directories and files.
Iterate over the dependencies list and test each object if itβs a directory, and if so, dispatch to the directory handler, otherwise, process as a file.
- Parameters:
results β list object to append BuildError objects
processed β List of directories already processed.
dependencies β iterable list of files/directories to process
args β parsed argument list for verbosity
- Returns:
True if processing should abort, False if not.
buildme.mainο
- makeprojects.buildme.main(working_directory=None, args=None)ο
Command line shell for
buildme.Entry point for the program
buildme, this function will either get the parameters fromsys.argvor the paramaterargs.--version, show version.-r, Perform a recursive rebuild.-v, Verbose output.-n, Preview build commands--generate-rules, Create build_rules.py and exit.--rules-file, Override the configruration file.-q, Quit after the first error-f, List of files to build.-d, List of directories to build.-c, List of configurations to build-docs, Compile Doxyfile files.Additional terms are considered specific files or configurations to build.
- Parameters:
working_directory β Directory to operate on, or
None.args β Command line to use instead of
sys.argv.
- Returns:
Zero on no error, non-zero on error
Rebuildο
rebuild.mainο
- makeprojects.rebuildme.main(working_directory=None, args=None)ο
Invoke the command line
rebuildme.Entry point for the program
rebuildme, this function will either get the parameters fromsys.argvor the paramaterargs.--version, show version.-r, Perform a recursive rebuild.-v, Verbose output.--generate-rules, Create build_rules.py and exit.--rules-file, Override the configruration file.-f, Stop building on the first build failure.-d, List of directories to rebuild.-docs, Compile Doxyfile files.Additional terms are considered specific files to build.
- Parameters:
working_directory β Directory to rebuild, or
Noneforos.getcwd()args β Command line to use instead of
sys.argv
- Returns:
Zero on no error, non-zero on error
Enumsο
enums.source_file_filterο
- makeprojects.enums.source_file_filter(file_list, file_type_list)ο
Prune the file list for a specific type.
Note
file_type_list can either be a single enums.FileTypes enum or an iterable list of enums.FileTypes
- Parameters:
file_list β list of core.SourceFile entries.
file_type_list β enums.FileTypes to match.
- Returns:
list of matching core.SourceFile entries.
enums.get_installed_visual_studioο
enums.get_installed_xcodeο
enums.platformtype_short_codeο
- makeprojects.enums.platformtype_short_code(configurations)ο
Iterate over a list of Configurations to determine the short code.
For files that create multiple platforms, determine if it matches a known expandable PlatformType
- Parameters:
configurations β List of configurations to scan
- Returns:
Either ββ or the generic short code of the group or the first code in the configuration list.
enums.get_output_templateο
- makeprojects.enums.get_output_template(project_type, platform)ο
Determine the file prefix and suffix for the binary.
Using the project type and platform, determine if the final binary name template so that if the output was used with format(), it will create the binary filename appropriate for the platform.
- Parameters:
project_type β ProjectTypes enum
platform β PlatformTypes enum
- Returns:
String to be used with format() to create the final name.
Utilο
util.validate_enum_typeο
- makeprojects.util.validate_enum_type(value, data_type)ο
Verify a value is a specific data type.
Check if the value is either None or an instance of a specfic data type. If so, return immediately. If the value is a string, call the lookup() function of the data type for conversion.
- Parameters:
value β Value to check.
data_type β Type instance of the class type to match.
- Throws TypeError:
- Returns:
Value converted to data_type or None.
util.regex_dictο
- makeprojects.util.regex_dict(value)ο
Convert *.cpp keys to regex keys.
Given a dict where the keys are all filenames with wildcards, convert only the keys into equivalent regexes and leave the values intact.
Examples
rules = { "*.cpp": {"a": "arf", "b": "bark", "c": "coo"}, "*.h": {"h": "help"} } regex_keys = regex_dict(rules)
- Parameters:
value β dict to convert
- Returns:
dict with keys converted to regexes
util.validate_booleanο
- makeprojects.util.validate_boolean(value)ο
Verify a value is a boolean.
Check if the value can be converted to a bool, if so, return the value as bool. None is converted to False.
- Parameters:
value β Value to check.
- Throws ValueError:
- Returns:
Value converted to data_type or None.
util.validate_stringο
- makeprojects.util.validate_string(value)ο
Verify a value is a string.
Check if the value is a string, if so, return the value as is or None.
- Parameters:
value β Value to check.
- Throws ValueError:
- Returns:
Value is string or None.
util.clear_build_rules_cacheο
- makeprojects.util.clear_build_rules_cache()ο
Clear the build rules cache.
util.load_build_rules uses a cache. Call this function to clear the cache without calling util.load_build_rules to do it.
See also
util.load_build_rulesο
- makeprojects.util.load_build_rules(path_name, clear_cache=False)ο
Load build_rules using a cache.
Check if the path was already loaded. If so, use the cached version, otherwise load and cache the build_rules.py script
See also
- Parameters:
path_name β Full pathname to the build_rules.py script
clear_cache β Boolean, if true, clear the cache first
util.getattr_build_rulesο
- makeprojects.util.getattr_build_rules(build_rules, attributes, fallback=None)ο
Find an attribute in a build rules module.
Scan the build rules until an attribute value is found. It will return the first one found. If none are found, this function returns
fallback.This function returns two values, the first is the attribute value, the second is a boolean of
Truemeaning the attribute was found, orFalseif the default value was returned.- Parameters:
build_rules β
build_rules.pymodule instance.attributes β String or list of strings, attribute name(s).
fallback β Value to return if the attribute was not found.
- Returns:
Tuple of attribute value found in
build_rules, orfallbackand the second value isTrueif found,Falseif default was- Returns:
used.
util.getattr_build_rules_listο
- makeprojects.util.getattr_build_rules_list(build_rules_list, attributes, fallback)ο
Find an attribute in a list of build rules.
Iterate over the build rules list until an entry has an attribute value. It will return the first one found. If none are found, or there were no entries in
build_rules_list, this function returnsfallback.- Parameters:
build_rules_list β List of
build_rules.pyinstances.attributes β String or list of strings, attribute name(s).
fallback β Value to return if the attribute was not found.
- Returns:
Attribute value found in
build_rules_listentry, orfallback.
util.add_build_rulesο
- makeprojects.util.add_build_rules(build_rules_list, file_name, verbose, is_root, basename)ο
Load in the file
build_rules.pyLoad the build_rules.py file. If the variable
*_GENERICisTrueor ifis_rootisTrue, append the module tobuild_rules_list. If the variable*_CONTINUEwas found in the file, check if it is set toTrue. If so, returnTrueto allow processing to continue. If the file is not found, returnTrueto allow processing the parent folder.Since this is called from
buildme,cleanme, andmakeprojects, the prefix needed for the tool is passed inbasename. An example is βCLEANMEβ.- Parameters:
build_rules_list β List to add
build_rules.pyinstances.file_name β Full path name of the build_rules.py to load.
verbose β True for verbose output.
is_root β True if *_GENERIC is ignored.
basename β Variable prefix to substitute * in *_GENERIC
- Returns:
True if the parent folder should be checked, False if not.
util.get_build_rulesο
- makeprojects.util.get_build_rules(working_directory, verbose, build_rules_name, basename)ο
Find all
build_rules.pyfiles that apply to this directory.If no files are found, return an empty list.
- Parameters:
working_directory β Directory to scan for
build_rules.pyverbose β True if verbose output is desired
build_rules_name β
build_rules.pyor an overridebasename β βCLEANMEβ, βBUILDMEβ, etc.
- Returns:
List of loaded
build_rules.pyfile modules
util.remove_ending_os_sepο
- makeprojects.util.remove_ending_os_sep(input_list)ο
Iterate over a string list and remove trailing os separator characters.
Each string is tested if its length is greater than one and if the last character is the pathname separator. If so, the pathname separator character is removed.
- Parameters:
input_list β list of strings
- Throws TypeError:
- Returns:
Processed list of strings
util.was_processedο
- makeprojects.util.was_processed(processed, path_name, verbose)ο
Check if a file or directory has already been processed.
To prevent recursion, expand the path name to an absolution path call this function with a set that will store all the entries and the entry to test. If the entry is already in the set, report the issue and return
True. Otherwise, add the entry to the set and returnFalseto allow the path to be processed.- Parameters:
processed β Set to store processed pathnames
path_name β Path to a directory or file
verbose β True if verbose output is requested
- Returns:
True if itβs already in the set. False if not.
util.fixup_argsο
- makeprojects.util.fixup_args(args)ο
Check unused args if they are directories, files or configurations.
The args object has the attributes
args,directories,configurations, andfiles. The attribute args has all the unparsed arguments that will be tested to see if they are a file, directory or a string. The entries will be added to their appropriate attribute, with strings appended toconfigurations. Attributeargsis set to None.- Parameters:
args β args class from argparser
util.convert_file_nameο
- makeprojects.util.convert_file_name(item, source_file)ο
Convert macros to literal filename strings.
- Parameters:
item β Filename string
source_file β SourceFile object
- Returns:
String with converted macros
util.do_generate_build_rulesο
- makeprojects.util.do_generate_build_rules(parsed, working_directory)ο
Test if the parsed parameters have —generate-rules.
If —generate-rules was not invoked, return None. Otherwise return a numeric error code.
- Parameters:
parsed β An ArgumentParser object with attribute generate_build_rules
working_directory β Directory to store the build_rules.py
- Returns:
None or an integer error code
util.iterate_configurationsο
- makeprojects.util.iterate_configurations(solution)ο
Iterate all configurations in a solution.
Given a solution, iterate over all of the configurations within the solution and return each object.
- Parameters:
solution β Solution object.
- Returns:
Iterator that returns configuration objects.
validators.lookup_enum_valueο
- makeprojects.validators.lookup_enum_value(enum_lookup, key, fallback)ο
Find a value in a list of enums.
Iterate over a list of two entry tuples, the first entry is the key and the second is the value. Essentually, itβs a dict implemented as a list/tuple.
- Parameters:
enum_lookup β iterable of enumeration entries (key, integer)
key β Key value to match in enumeration keys
fallback β Value to return if there is no match
- Returns:
Second value in the enumeration entry where the key matches, or
fallback
validators.lookup_enum_append_keyο
- makeprojects.validators.lookup_enum_append_key(cmd, enum_lookup, value)ο
Look up a command line option from an enumeration.
Iterate over a list of tuples, with the first entry is a command line entry and the second entry is the integer enumeration value. If the value is a match to the enumeration value, append the command line entry to
cmd.- Parameters:
cmd β list of command line options to append the new entry
enum_lookup β iterable of enumeration entries (key, integer)
value β integer enumeration value to match in enum_lookup
- Throws ValueError:
- Returns:
cmd, which may have been modified.
validators.lookup_enum_append_keysο
- makeprojects.validators.lookup_enum_append_keys(cmd, enum_dicts, command_dict)ο
Look up a set of enum command line options.
A command_dict has keys in the form of Visual Studio XML entries with the data being the expected setting, or None for default. If the value starts with
_NOT_USED, itβs considered None and will use the default.Note
Enumeration entries are a list of tuples where the first entry is the command line switch and the second entry is an integer as the enumeration value. If multiple entries have the same integer, the first entry is the default.
- Parameters:
cmd β list of command line options to append the new entry
enum_dicts β Iterable of enumeration entries
command_dict β dict of command entries
- Throws ValueError:
- Returns:
Argument
cmdis returned.
validators.lookup_stringsο
- makeprojects.validators.lookup_strings(cmd, string_entries, command_dict)ο
Lookup string items and add them to the command line.
The command dictionary has a key of the Visual Studio XML name and the data is a valid string, usually a filename. If the data is None, the default string is used.
String entries are a list of tuples where the first entry is the key and the second entry is a four entry tuple with the actions.
The function will return a list of strings of output files so the caller can properly create the
makeentries for output files for the dependency tree.The four entry tuple is as follows:
String/None, Output filename if any, or None for no output.
String, command line switch, may have a space at the end.
Boolean, if True, encapsulate the output filename with quotes.
Boolean, if True, add the string to the return list.
- Parameters:
cmd β list of command line options to append the new entry
string_entries β dict of string entries
command_dict β dict of command entries
- Returns:
String list of string items the generate output
validators.lookup_string_listο
- makeprojects.validators.lookup_string_list(cmd, switches, entry_list, quotes=True)ο
Create a command line with an entry list.
Given a list of strings in entry_list, add to a command line a compiler switch followed by each string with or without quotes. If the switch has an ending space, the space is removed and entries are stored in separate lines.
- Parameters:
cmd β list of command line options to append the new entry.
switches β String, Command line switch string.
entry_list β List of parameter strings.
quotes β Boolean, True caused the entries to be quoted.
- Returns:
- Returns:
None
validators.lookup_string_listsο
- makeprojects.validators.lookup_string_lists(cmd, string_list, command_dict)ο
Lookup string items and add them to the command line.
The command_dict has the overrides where the value is either a single string or an array of strings or
None.The string_list is an iterable of tuples where the first entry is a string of the Visual Studio XML name and the second entry is a 2 entry tuple, where the first entry is the command line switch and the second entry is a boolean where if
Truewill have the string in quotes.Note
If a command line switch ends with a space, it will be used as a flag to append the parameter string as a separate line in the cmd list.
- Parameters:
cmd β list of command line options to append the new entry.
string_list β dict of string list entries.
command_dict β dict of command entries.
- Returns:
- Returns:
None
validators.lookup_booleansο
- makeprojects.validators.lookup_booleans(cmd, boolean_list, command_dict)ο
Look up a command line option from a list of booleans.
The command dict is a dict of Visual Studio XML entries where the value is None, or a value that will be converted into a boolean.
The boolean list is an iterable of tuples where the first entry is the Visual Studio XML entry and the second is a variable length tuple where the first entry is the default value followed by pairs of values of a string for the command line switch and then the boolean to match.
- Parameters:
cmd β list of command line options to append the new entry.
boolean_list β list of boolean entries.
command_dict β dict of command entries.
- Returns:
- Returns:
None
Defaultsο
defaults.settings_from_nameο
- makeprojects.defaults.settings_from_name(configuration)ο
Given a configuration name, set default settings.
Default names are Debug, Internal, Release, Release_LTCG, Profile, Profile_FastCap and CodeAnalysis. If the setting name is one of these, or a variant, settings like debug, optimization, short_code, or profile are preset.
- Parameters:
configuration β Configuration to update
- Returns:
- Returns:
configuration
defaults.configuration_presetsο
- makeprojects.defaults.configuration_presets(configuration)ο
Set the default settings for a configuration.
Scan a configuration for a platform and an ide and set up compiler macros and other settings that are default for the specific platform.
- Parameters:
configuration β Configuration record to update.
defaults.get_project_nameο
- makeprojects.defaults.get_project_name(build_rules_list, working_directory, verbose=False, project_name=None)ο
Determine the project name.
Scan the build_rules.py file for the variable PROJECT_NAME, and if found use that string for the project name. Otherwise, use the name of the working folder.
- Parameters:
build_rules_list β List of build_rules to iterate over.
working_directory β Full path name of the build_rules.py to load.
verbose β Boolean, True if name is to be printed
project_name β String, project name override
- Returns:
Name of the project.
defaults.get_project_typeο
- makeprojects.defaults.get_project_type(build_rules_list, verbose=False, project_type=None)ο
Determine the project type.
Scan the build_rules.py file for the variable PROJECT_TYPE, and if found use that string for the project type. Otherwise, assume itβs a command line tool.
- Parameters:
build_rules_list β List of build_rules to iterate over.
verbose β Boolean, True for verbose output
project_type β Proposed project type.
- Returns:
ProjectTypes enumeration.
defaults.get_platformο
- makeprojects.defaults.get_platform(build_rules_list, verbose=False, platform=None)ο
Determine the platforms to generate projects for.
Scan the build_rules.py file for the variable PROJECT_PLATFORM, and if found use that list of PlatformTypes or strings to lookup with PlatformTypes.lookup().
- Parameters:
build_rules_list β List to append a valid build_rules file instance.
verbose β Boolean, True for verbose output
platform β Proposed platform type.
- Returns:
Platform to generate project for.
defaults.guess_ideο
- makeprojects.defaults.guess_ide(platform)ο
Guess the IDE for a specific platform.
In cases where the platform is known, but the IDE is not, return the most likely IDE to use for building the platform.
- Parameters:
platform β Platform to build for.
- Returns:
IDETypes of the recommended IDE, or None if not known.
defaults.get_ideο
- makeprojects.defaults.get_ide(build_rules_list, verbose=False, ide=None, platform=None)ο
Determine the IDEs to generate projects for.
Scan the build_rules.py file for the variable PROJECT_IDE, and if found use that IDETypes or string to lookup with IDETypes.lookup().
- Parameters:
build_rules_list β List to append a valid build_rules file instance.
verbose β Boolean, True for verbose output
ide β Proposed ide type.
platform β Platform to build for, used for guess_ide
- Returns:
IDE to generate project for.
defaults.default_configuration_listο
- makeprojects.defaults.default_configuration_list(platform, ide)ο
Create the default configurations.
- Parameters:
platform β platform being built.
ide β IDE being generated for.
- Returns:
List strings with names of configurations.
defaults.get_configuration_listο
- makeprojects.defaults.get_configuration_list(build_rules_list, configurations, platform, ide)ο
Determine the configurations to generate projects for.
Scan the build_rules.py file for the command βconfiguration_listβ and if found, use that list of strings to create configurations.
- Parameters:
build_rules_list β List to append a valid build_rules file instance.
configurations β List of configuration names
platform β Platform building.
ide β IDETypes for the ide generating for.
- Returns:
List of configuration strings to generate projects for.
Visual Studioο
visual_studio.SUPPORTED_IDESο
visual_studio.parse_sln_fileο
- makeprojects.visual_studio.parse_sln_file(full_pathname)ο
Find build targets in .sln file.
Given a .sln file for Visual Studio 2003 through 2022, locate and extract all of the build targets available and return the list.
It will also determine which version of Visual Studio this solution file requires.
- Parameters:
full_pathname β Pathname to the .sln file
- Returns:
tuple(list of configuration strings, integer Visual Studio version year)
visual_studio.matchο
- makeprojects.visual_studio.match(filename)ο
Check if the filename is a type that this module supports.
Match if the filename ends with .sln.
- Parameters:
filename β Filename to match
- Returns:
False if not a match, True if supported
visual_studio.create_build_objectο
- makeprojects.visual_studio.create_build_object(file_name, priority=50, configurations=None, verbose=False)ο
Create BuildVisualStudioFile build records for every desired configuration.
- Parameters:
file_name β Pathname to the *.sln to build
priority β Priority to build this object
configurations β Configuration list to build
verbose β True if verbose output
- Returns:
list of BuildVisualStudioFile classes
visual_studio.create_clean_objectο
- makeprojects.visual_studio.create_clean_object(file_name, priority=50, configurations=None, verbose=False)ο
Create BuildVisualStudioFile clean records for every desired configuration.
- Parameters:
file_name β Pathname to the *.sln to build
priority β Priority to clean this object
configurations β Configuration list to clean
verbose β True if verbose output
- Returns:
list of BuildVisualStudioFile classes
visual_studio.testο
- makeprojects.visual_studio.test(ide, platform_type)ο
Filter for supported platforms.
Test for classic xbox that can be built with Visual Studio 2003. Windows on all versions.
Game consoles, are a long listβ¦
- Parameters:
ide β enums.IDETypes
platform_type β enums.PlatformTypes
- Returns:
True if supported, False if not
visual_studio.do_filter_treeο
- makeprojects.visual_studio.do_filter_tree(xml_entry, filter_name, tree, groups)ο
Recursively create a Filter/File tree.
Dump out a recursive tree of files to reconstruct a directory hiearchy for a file list with XML Filter records.
- Parameters:
xml_entry β Root entry to attach records to.
filter_name β Name of the current filter
tree β dict() containing the file list
groups β List of filter entries to match to the tree
visual_studio.generateο
- makeprojects.visual_studio.generate(solution)ο
Create a solution and project(s) file for Visual Studio.
Given a Solution object, create an appropriate Visual Studio solution and project files to allow this project to build.
- Parameters:
solution β Solution instance.
- Returns:
Zero if no error, non-zero on error.
visual_studio_utils.get_path_propertyο
- makeprojects.visual_studio_utils.get_path_property(ide, pathname)ο
If a path is relative, return the proper object.
Check if a pathname starts with a β.β, which means itβs relative to the project. If so, return a RelativePath string, otherwise return a FileName string. Special case for Visual Studio 2003, it only accepts
RelativePathas a parameter- Parameters:
ide β enums.IDETypes of the IDE being generated for.
pathname β Pathname to test.
- Returns:
validators.VSStringProperty of type RelativePath or FileName
visual_studio_utils.get_toolset_versionο
- makeprojects.visual_studio_utils.get_toolset_version(ide)ο
Get the toolset version for the Visual Studio version.
Each version of Visual Studio uses a toolset version specific to that version. Return the version number for the vcxproj file.
Strings returned are β4.0β, β12.0β, β14.0β and β15.0β.
- Parameters:
ide β enums.IDETypes of the IDE being generated
- Returns:
String of the toolset version for the ide
visual_studio_utils.convert_file_name_vs2010ο
- makeprojects.visual_studio_utils.convert_file_name_vs2010(item)ο
Convert macros from to Visual Studio 2003-2008.
This table shows the conversions
Visual Studio 2010+
2003-2008
%(RootDir)%(Directory)
$(InputDir)
%(FileName)
$(InputName)
%(Extension)
$(InputExt)
%(FullPath)
$(InputPath)
%(Identity)
$(InputPath)
- Parameters:
item β Filename string
- Returns:
String with converted macros
visual_studio_utils.wiiu_propsο
- makeprojects.visual_studio_utils.wiiu_props(project)ο
If the project is for WiiU, check if there are assembly files.
If there are assembly files, add the Nintendo supplied props file for assembly language support.
Note
This assumes that the official WiiU SDK from Nintendo is installed on the machine that will build this project file.
- Parameters:
project β Project to check
visual_studio_utils.add_masm_supportο
- makeprojects.visual_studio_utils.add_masm_support(project)ο
If the project is has assembly files, add the props files.
This function works for Visual Studio 2003-2022.
Note
Visual Studio 2003 only supports x86 files
Visual Studio 2005-2015 only support x86 and x64 files
Visual Studio 2017+ support arm, arm64, x86, and x64 files
- Parameters:
project β Project to check
visual_studio_utils.get_cpu_folderο
- makeprojects.visual_studio_utils.get_cpu_folder(platform)ο
If the platform is a Windows type, return the CPU name.
Returns None, βx86β, βx64β, βarmβ, βarm64β, or βia64β
- Parameters:
platform β enums.PlatformTypes to check
- Returns:
None or platform CPU name.
visual_studio_utils.generate_solution_fileο
- makeprojects.visual_studio_utils.generate_solution_file(solution_lines, solution)ο
Serialize the solution file into a string array.
This function generates SLN files for all versions of Visual Studio. It assumes the text file will be encoded using UTF-8 character encoding so the resulting file will be pre-pended with a UTF-8 Byte Order Mark (BOM) for Visual Studio 2005 or higher.
Note
Byte Order Marks are not supplied by this function.
- Parameters:
solution_lines β List to insert string lines.
solution β Reference to the raw solution record
- Returns:
Zero on success, non-zero on error.
visual_studio_utils.create_copy_file_scriptο
- makeprojects.visual_studio_utils.create_copy_file_script(source_file, dest_file, perforce)ο
Create a batch file to copy a single file.
Create a list of command lines to copy a file from source_file to dest_file with perforce support.
This is an example of the Windows batch file. The lines for the tool
p4are added if perforce=True.p4 edit dest_file copy /Y source_file dest_file p4 revert -a dest_file
See also
- Parameters:
source_file β Pathname to the source file
dest_file β Pathname to where to copy source file
perforce β True if perforce commands should be generated.
- Returns:
List of command strings for Windows Command shell.
visual_studio_utils.create_deploy_scriptο
- makeprojects.visual_studio_utils.create_deploy_script(configuration)ο
Create a deployment batch file if needed.
If an attribute of
deploy_folderexists, a batch file will be returned that has the commands to copy the output file to the folder named indeploy_folder.Two values are returned, the first is the command description suitable for Visual Studio Post Build and the second is the batch file string to perform the file copy. Both values are set to None if
deploy_folderis empty.mkdir final_folder p4 edit dest_file copy /Y source_file dest_file p4 revert -a dest_file
See also
Note
If the output is
project_typeof Tool, the folder will have cpu name appended to it and any suffix stripped.- Parameters:
configuration β Configuration record.
- Returns:
None, None or description and batch file string.
Watcomο
watcom.SUPPORTED_IDESο
watcom.matchο
- makeprojects.watcom.match(filename)ο
Check if the filename is a project type that this module supports.
Check if the project file ends with β.wmkβ, return True if so.
- Parameters:
filename β Filename to match
- Returns:
False if not a match, True if supported
watcom.create_build_objectο
- makeprojects.watcom.create_build_object(file_name, priority=50, configurations=None, verbose=False)ο
Create BuildWatcomFile build records for every desired configuration.
- Parameters:
file_name β Pathname to the *.wmk to build
priority β Priority to build this object
configurations β Configuration list to build
verbose β True if verbose output
- Returns:
list of BuildWatcomFile classes
watcom.create_clean_objectο
- makeprojects.watcom.create_clean_object(file_name, priority=50, configurations=None, verbose=False)ο
Create BuildWatcomFile clean records for every desired configuration.
- Parameters:
file_name β Pathname to the *.wmk to build
priority β Priority to build this object
configurations β Configuration list to build
verbose β True if verbose output
- Returns:
list of BuildWatcomFile classes
watcom.testο
- makeprojects.watcom.test(ide, platform_type)ο
Filter for supported platforms.
Watcom supports MSDOS 4GW, MSDOS X32 and Windows 32 only.
- Parameters:
ide β IDETypes
platform_type β enums.PlatformTypes
- Returns:
True if supported, False if not
watcom.generateο
- makeprojects.watcom.generate(solution)ο
Create a project file for Watcom.
Given a Solution object, create an appropriate Watcom WMAKE file to allow this project to build.
- Parameters:
solution β Solution instance.
- Returns:
Zero if no error, non-zero on error.
watcom_util.fixup_envο
- makeprojects.watcom_util.fixup_env(item)ο
Check if a path has an environment variable.
If an pathname starts with $(XXX), then it needs to be invoking an environment variable. Watcom uses the form $(%XXX) so insert a percent sign to convert to Watcom format if needed. If it already has a percent sign, donβt change the string.
- Parameters:
item β String to check
- Returns:
Updated pathname using $(%XXX) format
watcom_util.convert_file_name_watcomο
- makeprojects.watcom_util.convert_file_name_watcom(item)ο
Convert macros from Visual Studio to Open Watcom.
This table shows the conversions
Visual Studio
Watcom
%(RootDir)%(Directory)
$[:
%(FileName)
$[&
%(FullPath)
$[@
%(Identity)
$[@
$(TargetPath)
$^@
- Parameters:
item β Filename string
- Returns:
String with converted macros
watcom_util.get_element_dictο
- makeprojects.watcom_util.get_element_dict(rule_list, base_name, tool_enums)ο
Create Visual Studio style element list.
Given a list of rules, the base name of the source file, and the enumeration table for the command generator, return a dict with all the keys and values for the Visual Studio overrides for this file.
This is usually parsed by the HLSL and GLSL command generators.
Note
The returned value is a dict using Visual Studio elements as keys with the parameter template string as the value. Example keys are
ObjectFileName,VariableName, andHeaderFileName.- Parameters:
rule_list β Iterable of a list of rules
base_name β Name of the source file to check
tool_enums β Enumeration lookup for the command generator
- Returns:
dict of values for file overrides, can be empty
watcom_util.get_custom_listο
- makeprojects.watcom_util.get_custom_list(custom_list, rule_list, codefiles)ο
Scan the custom rules and create a list of bespoke builders.
First, convert the rule list into the Visual Studio dictionaries, and then use the GLSL or HLSL command line generators to create
Next, iterate over the codefiles for any GLSL or HLSL files and apply the rules (If found) and create the command lines needed to build the files.
If any custom build commands are generated, they are appended to
custom_listas a 4 entry tuple, with the first entry being the command line, the second is a text description of the command, the third is the name of the output file(s) and lastly the input filename.- Return
custom_list
- Parameters:
custom_list β list object to receive new entries
rule_list β Tuple of rules
codefiles β List of SourceFile objects to check
watcom_util.get_output_listο
- makeprojects.watcom_util.get_output_list(custom_list)ο
Scan the custom_list and return the output files.
Create a list of output filenames and sort them before returning the list. The third entry of the
custom_listis the output filename.See also
- Return
List of output file names
- Parameters:
custom_list β List of custom commands
watcom_util.get_obj_listο
- makeprojects.watcom_util.get_obj_list(codefiles, type_list)ο
Extract a list of file names without extensions.
Given a codefiles list and a list of acceptable types, return a list of filenames stripped of their extensions and directories.
See also
- Parameters:
codefiles β Codefiles list from the project
type_list β List of enums.FileTypes objects
- Returns:
List of processed matching filenames, or empty list
watcom_util.add_obj_listο
- makeprojects.watcom_util.add_obj_list(line_list, obj_list, prefix, suffix)ο
Create a list of object files with prefix.
Give a list of filenames without extensions, create a Watcom compatible list with an $(A) prefix for runtime pathname substitution. Add the supplied prefix to all filenames.
The filename list is sorted before processing.
- Parameters:
line_list β Output file
obj_list β List of filenames without extensions
prefix β Variable name for the list
suffix β Object file suffix
watcom_util.add_post_buildο
- makeprojects.watcom_util.add_post_build(line_list, configuration)ο
If there are custom build rules, add them.
Scan the configuration attribute
post_buildand if it exists, append the commands toline_list.See also
See also
- Parameters:
line_list β Output stream
configuration β Project configuration
watcom_util.watcom_linker_systemο
- makeprojects.watcom_util.watcom_linker_system(configuration)ο
Determine the watcom system for linkage.
Scan the configuration and return the string βsystem ???β where ??? is replaced with dos4g, nt, etc.
Can be overriden with the attribute
wat_system. If this exists, use it to declare βsystem ???β or ββ to disable.- Return
String βsystem β + actual type
- Parameters:
configuration β Project configuration
watcom_util.warn_if_invalidο
- makeprojects.watcom_util.warn_if_invalid(solution)ο
Iterate over the solution and determine if there are errors.
Test for use of use_mfc or use_atl
- Parameters:
solution β Reference to a solution record
- Returns:
Zero if no error, non-zero if error