Classes

Enumerations

enums.FileTypes

makeprojects.enums.FileTypes : public IntEnum

Enumeration of supported file types for project input.

Each file that is to be added to a project has specific build rules, this enumeration helps determine which compiler to invoke to build the file if a build step is necessary.

Public Functions

__repr__(self)

Convert the enumeration into a human readable file description.

Returns

Human readable string or None if the enumeration is invalid

Public Static Functions

lookup(test_name)

Look up a file name extension and return the type.

Parse the filename extension and match it to a table of known extensions and return the enumeration for the file type. The test is case insensitive.

Parameters

test_name – Filename to test

Returns

A FileTypes member or None on failure

Public Static Attributes

user = 0

User file type (Unknown)

generic = 1

Non compiling file type.

c = 2

Compile as C.

cpp = 3

Compile as C++.

h = 4

C/C++ header.

m = 5

Objective-C.

xml = 6

XML text file.

rc = 7

Windows resource file.

r = 8

Mac OS resource file.

hlsl = 9

HLSL DirectX Shader.

glsl = 10

GLSL OpenGL Shader.

x360sl = 11

Xbox 360 DirectX Shader.

vitacg = 12

Playstation Vita CG Shader.

frameworks = 13

Mac OSX Framework.

library = 14

Static libary.

object = 15

Object code.

exe = 16

Executable file.

xcconfig = 17

XCode configuration file.

x86 = 18

X86 assembly source.

x64 = 19

X64 assembly source.

a65 = 20

6502/65812 assembly source

ppc = 21

PowerPC assembly source.

a68 = 22

680x0 assembly source

image = 23

Image files.

ico = 24

Windows icon files.

icns = 25

MacOSX icon files.

appxmanifest = 26

Windows AppXManifest files.

enums.IDETypes

makeprojects.enums.IDETypes : public IntEnum

Enumeration of supported IDEs.

All supported IDEs and makefile formats are enumerated here.

Public Functions

get_short_code(self)

Create the ide code from the ide type.

Return the three letter code that determines the specfic IDE version that the project file is meant for.

Returns

Three letter code specific to the IDE version or None.

is_visual_studio(self)

Determine if the IDE is Microsoft Visual Studio.

Returns

True if the platform is Microsoft Visual Studio.

is_xcode(self)

Determine if the IDE is Apple XCode.

Returns

True if the platform is Apple XCode.

is_codewarrior(self)

Determine if the IDE is Metrowerks / Freescale Codewarrior.

Returns

True if the platform is Metrowerks / Freescale Codewarrior.

__repr__(self)

Convert the enumeration into a human readable file description.

Returns

Human readable string or None if the enumeration is invalid

Public Static Functions

lookup(ide_name)

Look up a IDETypes based on name.

For maximum compatiblity, the name will be scanned from several look up tables to attempt to cover all premutations of an input string.

Note

String comparisons are case insensitive.

Parameters

ide_name – Platform string to test.

Returns

A IDETypes member or None on failure.

default()

Determine the default IDETypes from the currently running platform.

Public Static Attributes

vs2003 = 0

Visual studio 2003.

vs2005 = 1

Visual studio 2005.

vs2008 = 2

Visual studio 2008.

vs2010 = 3

Visual studio 2010.

vs2012 = 4

Visual studio 2012.

vs2013 = 5

Visual studio 2013.

vs2015 = 6

Visual studio 2015.

vs2017 = 7

Visual studio 2017.

vs2019 = 8

Visual studio 2019.

vs2022 = 9

Visual studio 2022.

watcom = 10

Open Watcom 1.9 or later.

codewarrior50 = 11

Metrowerks Codewarrior 9 / 5.0 (Windows/Mac OS)

codewarrior58 = 12

Metrowerks Codewarrior 10 / 5.8 (Mac OS Carbon)

codewarrior59 = 13

Freescale Codewarrior 5.9 (Nintendo DSi)

xcode3 = 14

XCode 3 (PowerPC 3.1.4 is the target version)

xcode4 = 15

XCode 4.

xcode5 = 16

XCode 5.

xcode6 = 17

XCode 6.

xcode7 = 18

XCode 7.

xcode8 = 19

XCode 8.

xcode9 = 20

XCode 9.

xcode10 = 21

XCode 10.

xcode11 = 22

XCode 11.

codeblocks = 23

Codeblocks.

nmake = 24

nmake

make = 25

make

bazel = 26

bazel

mpw = 27

MPW.

enums.PlatformTypes

makeprojects.enums.PlatformTypes : public IntEnum

Enumeration of supported target platforms.

All supported tool chains for specific platforms are enumerated here.

Public Functions

get_short_code(self)

Convert the enumeration to a 3 letter code for filename suffix.

Create a three letter code for the target platform for the final filename for the project. For platforms that support multiple CPU architectures, the code will be six letters long with the CPU appended to the three letter platform code.

Returns

A three or six letter code for the platform.

is_windows(self)

Determine if the platform is windows.

Returns

True if the platform is for Microsoft windows.

is_xbox(self)

Determine if the platform is a version of the Xbox.

Returns

True if the platform is for Xbox, Xbox 360, or Xbox ONE.

is_macosx(self)

Determine if the platform is macOS.

Returns

True if the platform is Apple macOS.

is_ios(self)

Determine if the platform is iOS.

Returns

True if the platform is Apple iOS.

is_macos(self)

Determine if the platform is MacOS classic or Carbon.

Returns

True if Apple MacOS 1.0 through 9.2.2 or the Carbon API.

is_macos_carbon(self)

Determine if the platform is MacOS Carbon.

Returns

True if the platform is Apple MacOS Carbon API.

is_macos_classic(self)

Determine if the platform is MacOS classic (MacOS 1.0 to 9.2.2).

Returns

True if the platform is Apple MacOS 1.0 through 9.2.2.

is_msdos(self)

Determine if the platform is MSDos.

Returns

True if the platform is MSDos

is_android(self)

Determine if the platform is Android.

Returns

True if the platform is Android

is_switch(self)

Determine if the platform is Nintendo Switch.

Returns

True if the platform is Nintendo Switch

get_platform_folder(self)

Return the name of a folder that would hold platform specific files.

match(self, second)

Test if two platform types are a match.

If two platform types are similar, this function will return True. An example would be a windows 32 bit and a windows 64 bit platform would match.

Returns

True if the types are compatible.

get_vs_platform(self)

Create the platform codes from the platform type for Visual Studio.

Visual Studio uses specific codes for tool chains used for video game consoles or CPUs. This function returns a list of codes needed to support the requested platform.

Returns

A list of Visual Studio platforms for target.

get_expanded(self)

Return a list of platforms from a platform that is a group.

is_expandable(self)

Return True if the platform defines other platforms.

__repr__(self)

Convert the enumeration into a human readable file description.

Returns

Human readable string or None if the enumeration is invalid

Public Static Functions

lookup(platform_name)

Look up a PlatformType based on name.

For maximum compatiblity, the name will be scanned from several look up tables to attempt to cover all premutations of an input string.

Note

String comparisons are case insensitive.

Parameters

platform_name – Platform string to test.

Returns

A PlatformTypes member or None on failure.

default()

Determine the PlatformTypes from the currently running platform.

Public Static Attributes

windows = 0

Windows 32 and 64 bit Intel and arm64.

windowsintel = 1

Windows 32 and 64 bit Intel.

windowsarm = 2

Windows 32 and 64 bit arm.

win32 = 3

Windows 32 bit intel only.

win64 = 4

Window 64 bit intel only.

winarm32 = 5

Windows 32 bit arm only.

winarm64 = 6

Windows 64 bit arm only.

winitanium = 7

Windows 64 bit itanium only.

macosx = 8

Mac OSX, all CPUs.

macosxppc32 = 9

Mac OSX PowerPC 32 bit only.

macosxppc64 = 10

Mac OSX PowerPC 64 bit only.

macosxintel32 = 11

Mac OSX Intel 32 bit only.

macosxintel64 = 12

Mac OSX Intel 64 bit only.

macos9 = 13

Mac OS 9, all CPUs.

macos968k = 14

Mac OS 9 680x0 only.

macos9ppc = 15

Mac OS 9 PowerPC 32 bit only.

maccarbon = 16

Mac OS Carbon, all CPUs.

maccarbon68k = 17

Mac OS Carbon 680x0 only (CFM)

maccarbonppc = 18

Mac OS Carbon PowerPC 32 bit only.

ios = 19

iOS, all CPUs

ios32 = 20

iOS 32 bit ARM only

ios64 = 21

iOS 64 bit ARM only

iosemu = 22

iOS emulator, all CPUs

iosemu32 = 23

iOS emulator 32 bit Intel only

iosemu64 = 24

iOS emulator 64 bit Intel only

xbox = 25

Microsoft Xbox classic.

xbox360 = 26

Microsoft Xbox 360.

xboxone = 27

Microsoft Xbox ONE.

ps1 = 28

Sony PS1.

ps2 = 29

Sony PS2.

ps3 = 30

Sony PS3.

ps4 = 31

Sony PS4.

psp = 32

Sony Playstation portable.

vita = 33

Sony Playstation VITA.

wii = 34

Nintendi Wii.

wiiu = 35

Nintendo WiiU.

switch = 36

Nintendo Switch.

switch32 = 37

Nintendo Switch 32 bit only.

switch64 = 38

Nintendo Switch 64 bit only.

dsi = 39

Nintendo 3DS.

ds = 40

Nintendo DS.

android = 41

Generic Android.

shield = 42

nVidia SHIELD

amico = 43

Intellivision Amico.

ouya = 44

Ouya (Now Razor)

tegra = 45

Android Tegra.

androidarm32 = 46

Android Arm32.

androidarm64 = 47

Android Arm64.

androidintel32 = 48

Android Intel x32.

androidintel64 = 49

Android Intel / AMD 64.

linux = 50

Generic Linux.

msdos = 51

MSDOS.

msdos4gw = 52

MSDOS Dos4GW.

msdosx32 = 53

MSDOS DosX32.

beos = 54

BeOS.

iigs = 55

Apple IIgs.

enums.ProjectTypes

makeprojects.enums.ProjectTypes : public IntEnum

Enumeration of supported project types.

Each configuration can build a specific type of file, this enumeration lists out the types of files that can be built.

Public Functions

is_library(self)

Determine if the project is a library.

Returns

True if the project is a static or dynamic library.

__repr__(self)

Convert the enumeration into a human readable file description.

Returns

Human readable string or None if the enumeration is invalid

Public Static Functions

lookup(project_type_name)

Look up a ProjectTypes based on name.

For maximum compatiblity, the name will be scanned from several look up tables to attempt to cover all premutations of an input string.

Note

String comparisons are case insensitive.

Parameters

project_type_name – Project type string to test.

Returns

A ProjectTypes member or None on failure.

default()

Determine the ProjectTypes default.

Public Static Attributes

library = 0

Code library.

tool = 1

Command line tool.

app = 2

Application.

screensaver = 3

Screen saver.

sharedlibrary = 4

Shared library (DLL)

empty = 5

Empty project.

Project Classes

core.SourceFile

class makeprojects.core.SourceFile

Object for each input file to insert to a solution.

For every file that could be included into a project file one of these objects is created and attached to a Project object for processing.

Public Functions

__init__(self, relative_pathname, working_directory, filetype)

Default constructor.

See also

enums.FileTypes

Parameters
  • relative_pathname – Filename of the input file (relative to the root)

  • working_directory – Pathname of the root directory

  • filetype – Compiler to apply

get_group_name(self)

Get the group location for this source file.

To determine if the file should be in a sub group in the project, scan the filename to find if it’s a base filename or part of a directory. If it’s a basename, return an empty string. If it’s in a folder, remove any ..\ prefixes and .\ prefixes and return the filename with the basename removed.

Returns

The group name string with \ delimiters.

get_abspath(self)

Return the full pathname of the file entry.

Returns

Absolute pathname for the file.

__repr__(self)

Convert the file record into a human readable file description.

Returns

Human readable string.

Public Members

relative_pathname

File base name with extension using windows style slashes.

working_directory

Directory the file is relative to.

type

File type enumeration, see: enums.FileTypes.

core.Configuration

makeprojects.core.Configuration : public makeprojects.core.Attributes

Object for containing attributes specific to a build configuration.

This object contains all of the items needed to create a specific configuration of a project.

Valid attributes:

  • name name of the configuration

  • short_code Short code suffix for configuration name

  • platform Platform to build for

  • project_type Type of binary to generate

  • exclude_from_build_list List of files to exclude from this configuration

  • include_folders_list List of directories for headers

  • library_folders_list List of directories for libraries

  • libraries_list List of libraries to include

  • frameworks_list List of frameworks to include (macOS/iOS)

  • define_list List of defines for compilation

  • debug True if debugging defaults are enabled

  • optimization 0-4 level of optimization

  • link_time_code_generation Enable link time code genration

See also

Project

See also

Solution

Public Functions

__init__(self, args, kargs)

Init defaults.

Parameters
  • args – name and setting_name for get_configuration_settings(_

  • kargs – List of defaults.

ide(self)

Return the preferred IDE.

short_code(self)

Return the short code.

short_code(self, value)

Set the filename suffix.

Parameters
  • self – The ‘this’ reference.

  • value – New short code

parse_attributes(self, build_rules_list, working_directory)

Initialize the default attributes.

Parameters
  • build_rules_list – List to append a valid build_rules file instance.

  • working_directory – Full path name of the build_rules.py to load.

get_suffix(self, force_short=False)

Return the proposed suffix.

Each configuration can generate a seperate binary and if they are stored in the same folder, a suffix is appened to make the filename unique.

Parameters

force_short – True to force the platform code to 3 characters

Returns

A suffix of the IDE, Platform and Configuration short codes.

__repr__(self)

Convert the configuration record into a human readable description.

Returns

Human readable string.

Public Members

project

Project this Configuration is attached to.

Public Static Attributes

source_folders_list = NoneProperty('_source_folders_list')

Don’t allow source folders in configuration.

source_files_list = StringListProperty('_source_files_list')

Don’t allow source files to be added in a configuration.

vs_props = NoneProperty('_vs_props')

Don’t allow Visual Studio props files.

vs_targets = NoneProperty('_vs_targets')

Don’t allow Visual Studio targets files.

vs_rules = NoneProperty('_vs_rules')

Don’t allow Visual Studio rules files.

core.Project

makeprojects.core.Project : public makeprojects.core.Attributes

Object for processing a project file.

This object contains all of the items needed to generate a project.

Note

On most IDEs, this is merged into one file, but Visual Studio generates a project file for each project.

Public Functions

__init__(self, name=None, kargs)

Set defaults.

Parameters
  • name – Name of the project

  • kargs – dict of arguments.

ide(self)

Return the preferred IDE.

add_configuration(self, configuration)

Add a configuration to the list of configurations found in this project.

Given a new Configuration class instance, append it to the list of configurations that this project is managing.

Exception

TypeError if configuration is not a Configuration

Parameters
  • self – The ‘this’ reference.

  • configuration – Reference to an instance of a Configuration.

add_project(self, project)

Add a dependent project.

Exception

TypeError if project is not a Project

Parameters

projectProject to depend on.

get_project_list(self)

Return the project list for all projects.

Iterate over every project and sub project and return a flattened list.

Returns

list of every project in the solution.

set_platforms(self, platform)

Update all configurations to a new platform.

If there are no configurations, Debug and Release will be created.

Parameters

platform – Platform to change the configurations to.

parse_attributes(self, build_rules_list, working_directory)

Initialize the default attributes.

Parameters
  • build_rules_list – List to append a valid build_rules file instance.

  • working_directory – Full path name of the build_rules.py to load.

get_file_list(self, acceptable_list)

Obtain the list of source files.

Set up the variables codefiles with the list of source files found and _source_include_list with a list of relative to the working directory folders where the source code was found.

  • exclude_list for wildcard matching for files to exclude

  • source_folders_list for list of folders to search for source code

  • source_files_list list of files to add

Parameters

acceptable_list – List of acceptable FileTypes

__repr__(self)

Convert the solultion record into a human readable description.

Returns

Human readable string or None if the solution is invalid

Public Members

name

Project name.

working_directory

Working directory for the project.

solution

No parent solution yet.

configuration_list

Generate the default configurations.

project_list

Initial array of Project records that need to be built first.

codefiles

Initial array of SourceFile in the solution.

file_list

Used by scan_directory.

include_list

Used by scan_directory.

platform_code

Platform code for generation.

Public Static Attributes

source_folders_list = StringListProperty('_source_folders_list')

List of directories to scan for source code.

List of folders to scan for source code.

source_files_list = StringListProperty('_source_files_list')

List of generated source files to include in the project.

List of files to add to the project.

vs_props = StringListProperty('_vs_props')

List of props files for Visual Studio.

vs_targets = StringListProperty('_vs_targets')

List of targets file for Visual Studio.

vs_rules = StringListProperty('_vs_rules')

List of rules file for Visual Studio 2005-2008.

core.Solution

makeprojects.core.Solution : public makeprojects.core.Attributes

Object for processing a solution file.

This object contains all of the items needed to create a solution.

Public Functions

__init__(self, name=None, kargs)

Init defaults.

Parameters
  • name – Name of the Solution

  • kargs – dict of arguments.

ide(self)

Return the ide type.

ide(self, value)

Set the IDE type with validation.

Parameters
  • self – The ‘this’ reference.

  • value – None or new IDE type

add_project(self, project=None, project_type=None)

Add a project to the list of projects found in this solution.

Given a new Project class instance, append it to the list of projects that this solution is managing.

Parameters
  • self – The ‘this’ reference.

  • project – Reference to an instance of a Project.

  • project_type – Type of project to create.

add_tool(self, project=None)

Add a project to build a command line tool.

See also

add_project

add_app(self, project=None)

Add a project to build an application.

See also

add_project

add_library(self, project=None)

Add a project to build a static library.

See also

add_project

add_shared_library(self, project=None)

Add a project to build a dynamic library.

See also

add_project

get_project_list(self)

Return the project list for all sub projects.

Iterate over every sub project and return a flattened list.

Returns

list of every project in the project.

set_platforms(self, platform)

Update all configurations to a new platform.

If there are no configurations, Debug and Release will be created.

Parameters

platform – Platform to change the configurations to.

generate(self, ide=None)

Generate a project file and write it out to disk.

__repr__(self)

Convert the solultion record into a human readable description.

Returns

Human readable string or None if the solution is invalid

Public Members

name

Solution name.

working_directory

Working directory for the solution.

project_list

Initial array of Project records for projects.

ide_code

IDE code for generation.

platform_code

Platform code for generation.

Public Static Attributes

source_folders_list = StringListProperty('_source_folders_list')

List of directories to scan for source code.

List of folders to scan for source code.

source_files_list = StringListProperty('_source_files_list')

List of generated source files to include in the project.

List of files to add to the projects.

vs_props = NoneProperty('_vs_props')

Don’t allow Visual Studio props files.

vs_targets = NoneProperty('_vs_targets')

Don’t allow Visual Studio targets files.

vs_rules = NoneProperty('_vs_rules')

Don’t allow Visual Studio rules files.

perforce = BooleanProperty('_perforce')

Use perforce.

Enable perforce support.

verbose = BooleanProperty('_verbose')

Verbosity.

Enable output verbosity.

suffix_enable = BooleanProperty('_suffix_enable')

Enable the use of suffixes in creating filenames.

Enable appending suffixes to project names.

Build Classes

buildme.BuildError

makeprojects.buildme.BuildError : public object

Error message generated by builders.

When a builder completes, a BuildError class is created and appended to the results list for logging.

Public Functions

__init__(self, error, filename, configuration=None, msg=None)

Initializers for an BuildError.

Parameters
  • error – Integer error code, zero if not error

  • filename – File that generated the error

  • configuration – If applicable, configuration that was compiled

  • msg – Error message test, if available

__repr__(self)

Convert the error into a string.

Returns

A full error string.

get_error_code(self)

Return the integer error code.

Public Members

error

Integer error code.

filename

File name that generated the error.

configuration

Build configuration.

msg

Error message.

buildme.BuildObject

makeprojects.buildme.BuildObject : public object

Object describing something to build.

When the directory is parsed, a list of BuildObjects is generated and then sorted by priority and then built.

Subclassed by makeprojects.buildme.BuildCodeBlocksFile, makeprojects.buildme.BuildCodeWarriorFile, makeprojects.buildme.BuildDoxygenFile, makeprojects.buildme.BuildMakeFile, makeprojects.buildme.BuildNinjaFile, makeprojects.buildme.BuildPythonFile, makeprojects.buildme.BuildRezFile, makeprojects.buildme.BuildSlicerFile, makeprojects.buildme.BuildVisualStudioFile, makeprojects.buildme.BuildWatcomFile, makeprojects.buildme.BuildXCodeFile

Public Functions

__init__(self, file_name, priority, configuration=None)

Initializers for an BuildObject.

Parameters
  • file_name – Name of the file to build.

  • priority – Integer priority, lower will be built first.

  • configuration – Configuration to build

__repr__(self)

Convert the object into a string.

Returns

A full string.

build(self)

Perform the build operation.

Returns BuildError object as Unimplemented build.

run_command(self, cmd, verbose)

Issue a command and return the generated BuildError.

Parameters
  • cmd – command line to execute

  • verbose – True if verbose output is required

Returns

BuildError object with error condition, if any.

Public Members

file_name

Name of file to build.

priority

Numeric priorty in ascending order.

configuration

Configuration if applicable.