Makeprojects
Loading...
Searching...
No Matches
makeprojects.watcom_util Namespace Reference

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.

Detailed Description

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

Function Documentation

◆ 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_listOutput file
obj_listList of filenames without extensions
prefixVariable name for the list
suffixObject file suffix

◆ 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_build and if it exists, append the commands to line_list.

Parameters
line_listOutput stream
configurationProject configuration
See also
convert_file_name_watcom
fixup_env

◆ 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
itemFilename string
Returns
String with converted macros

◆ 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
itemString to check
Returns
Updated pathname using $(%XXX) format

◆ 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_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.

Parameters
custom_listlist object to receive new entries
rule_listTuple of rules
codefilesList of SourceFile objects to check
Return
custom_list

◆ 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, and HeaderFileName.
Parameters
rule_listIterable of a list of rules
base_nameName of the source file to check
tool_enumsEnumeration lookup for the command generator
Returns
dict of values for file overrides, can be empty

◆ 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.

Parameters
codefilesCodefiles list from the project
type_listList of enums.FileTypes objects
Returns
List of processed matching filenames, or empty list
See also
enums.FileTypes

◆ 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_list is the output filename.

Parameters
custom_listList of custom commands
Return
List of output file names
See also
get_custom_list

◆ 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
solutionReference to a solution record
Returns
Zero if no error, non-zero if error

◆ 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.

Parameters
configurationProject configuration
Return
String "system " + actual type