def genConfig(platform, configuration, outputPath): buildPath = 'build' msvcPath = os.path.join(buildPath, 'msvc') probeMakePath = os.path.join(msvcPath, 'probed_defs.mk') # # build-info.hh # buildInfoHeader = os.path.join(outputPath, 'build-info.hh') targetPlatform = 'mingw32' if platform == 'Win32': targetCPU = 'x86' elif platform == 'x64': targetCPU = 'x86_64' else: raise ValueError('Invalid platform: ' + platform) flavour = configuration installShareDir = '/opt/openMSX/share' #not used on Windows, so whatever generator = buildinfo2code.iterBuildInfoHeader(targetPlatform, targetCPU, flavour, installShareDir) outpututils.rewriteIfChanged(buildInfoHeader, generator) # # components.hh # componentsHeader = os.path.join(outputPath, 'components.hh') generator = components2code.iterComponentsHeader(probeMakePath) outpututils.rewriteIfChanged(componentsHeader, generator) # # systemfuncs.hh # systemFuncsHeader = os.path.join(outputPath, 'systemfuncs.hh') generator = systemfuncs2code.iterSystemFuncsHeader(systemfuncs2code.getSystemFuncsInfo()) outpututils.rewriteIfChanged(systemFuncsHeader, generator) # # resource-info.hh # resourceInfoHeader = os.path.join(outputPath, 'resource-info.h') generator = win_resource.iterResourceHeader() outpututils.rewriteIfChanged(resourceInfoHeader, generator) # # version.ii # versionHeader = os.path.join(outputPath, 'version.ii') generator = version2code.iterVersionInclude() outpututils.rewriteIfChanged(versionHeader, generator)
def writeAll(self): def iterVars(): yield '# Automatically generated by build system.' yield '# Non-empty value means found, empty means not found.' for library in self.libraries: for name in ( 'HAVE_%s_H' % library, 'HAVE_%s_LIB' % library, '%s_CFLAGS' % library, '%s_LDFLAGS' % library, ): yield '%s:=%s' % (name, self.outVars[name]) rewriteIfChanged(self.outMakePath, iterVars()) rewriteIfChanged( self.outHeaderPath, iterSystemFuncsHeader(self.functionResults), )