|
Makeprojects
|
Project file generator subroutines for Open Watcom 1.9. More...
Functions | |
| fixup_env (item) | |
| Check if a path has an environment variable. | |
| convert_file_name_watcom (item) | |
| Convert macros from Visual Studio to Open Watcom. | |
| get_element_dict (rule_list, base_name, tool_enums) | |
| Create Visual Studio style element list. | |
| get_custom_list (custom_list, rule_list, codefiles) | |
| Scan the custom rules and create a list of bespoke builders. | |
| get_output_list (custom_list) | |
| Scan the custom_list and return the output files. | |
| get_obj_list (codefiles, type_list) | |
| Extract a list of file names without extensions. | |
| add_obj_list (line_list, obj_list, prefix, suffix) | |
| Create a list of object files with prefix. | |
| add_post_build (line_list, configuration) | |
| If there are custom build rules, add them. | |
| watcom_linker_system (configuration) | |
| Determine the watcom system for linkage. | |
| warn_if_invalid (solution) | |
| Iterate over the solution and determine if there are errors. | |
Project file generator subroutines for Open Watcom 1.9.
This module contains classes needed to generate project files intended for use by Open Watcom 1.9
| 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.
| line_list | Output file |
| obj_list | List of filenames without extensions |
| prefix | Variable name for the list |
| suffix | Object file suffix |
| makeprojects.watcom_util.add_post_build | ( | line_list, | |
| configuration ) |
If there are custom build rules, add them.
Scan the configuration attribute post_build and if it exists, append the commands to line_list.
| line_list | Output stream |
| configuration | Project configuration |
| 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) | $^@ |
| item | Filename string |
| 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.
| item | String to check |
| 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_list as 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.
| custom_list | list object to receive new entries |
| rule_list | Tuple of rules |
| codefiles | List of SourceFile objects to check |
| 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.
| 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 |
| 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.
| codefiles | Codefiles list from the project |
| type_list | List of enums.FileTypes objects |
| 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_list is the output filename.
| custom_list | List of custom commands |
| 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
| solution | Reference to a solution record |
| 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.
| configuration | Project configuration |