Example #1
0
def generate(make, toolchains, output_path):
	api.log('GNU makefile generator', 0)
	api.log('Target directory: ' + output_path, 1)

	if not os.path.exists(output_path):
	    os.makedirs(output_path)

	# retrieve all workspaces
	workspaces = make.getConfigurationKeyValues('workspace')

	# process all workspaces
	for workspace in workspaces:
		builds = make.getConfigurationKeyValuesFilterByContext('build', smack.context({'workspace': workspace}))  # all build in this workspace

		for toolchain in toolchains:
			target = toolchain['target']
			if not isTargetSupported(target):
				print("Skipping unsupported target '%s'.\n" % target)
				continue

			for arch in toolchain['arch']:
				build_env = getTargetBuildEnv(target, arch)
				if not build_env:
					api.log('GNU make ignoring unsupported architecture ' + arch + ' for target ' + target + '.\n', 1)
					continue
				build_env['builds'] = builds

				f = open(output_path + '/' + target + '-' + arch + '_' + workspace + '.mk', 'w')
				outputHeader(f)
				outputGlobals(f, build_env)
				outputWorkspace(f, build_env, make, smack.context({'workspace': workspace, 'target': target, 'arch': arch}), output_path)
Example #2
0
def generate(make, toolchains, output_path):
	# retrieve all workspaces
	workspaces = make.getConfigurationKeyValues('workspace')

	# process all workspaces
	for workspace in workspaces:
		ctx = smack.context().clone({'workspace': workspace, 'target': 'android'})
		generateMakefile(make, ctx, toolchains, output_path)
Example #3
0
def generate(make, output_path):

	def getExe(name):
		return 'C:/Program Files (x86)/Graphviz2.30/bin/' + name + '.exe'

	graph = pydot.Dot(graph_type='digraph', ranksep='1.0', nodesep='0.3')
	graph.set_graphviz_executables({'dot': getExe('dot'), 'twopi': getExe('twopi'), 'neato': getExe('neato'), 'circo': getExe('circo'), 'fdp': getExe('fdp')})

	#
	ctx = smack.context({'workspace': 'gs', 'group': '*'})
	projects = make.getConfigurationKeyValuesFilterByContext('project', ctx)

	#
	nodes = []
	for project in projects:
		node = pydot.Node(project, shape='record', style='rounded', fillcolor='#777799', fontname='Arial')
		graph.add_node(node)
		nodes.append({'project': project, 'node': node})

	def findProjectNode(project):
		for node in nodes:
			if node['project'] == project:
				return node
		return None

	# insert dependencies
	for project in projects:
		node = findProjectNode(project)
		if node == None:
			continue

		deps = make.get('depends', ctx.clone({'project': project}))
		if deps != None:
			for dep in deps:
				dep_node = findProjectNode(dep)
				if dep_node != None:
					graph.add_edge(pydot.Edge(node['node'], dep_node['node']))

	# setup groups

	graph.write_png('deps.png')