if dependencies[file]:
			opath = getObjectPath(file)
			filename = os.path.splitext(os.path.split(file)[1])[0]
			# TODO: normalizing paths already in prependPath makes getObjectPath fail under cygwin
			deplist = sorted(dependencies[file], key=lambda s: str.lower(s.replace("/", "\\")))
			for depgroup in util2.group(deplist, DEPENDENCIES_PER_LINE):
				flatlist.append("%s\\%s.obj: $B\\%s" % (opath, filename, " $B\\".join(depgroup)))
	return flatlist

def normalizePaths(paths):
	return re.sub(r"( |\\)[^.\\\s]+\\..\\", r"\1", paths.replace("/", "\\"))

def injectDependencyList(flatlist):
	flatlist = "\n".join(sorted(flatlist, key=str.lower))
	flatlist = normalizePaths(flatlist)
	content  = "## Header-dependencies for src\* and src\*\*\n"
	content += "### the list below is auto-generated by update_dependencies.py\n"
	content += "B=$(BASEDIR)\n"
	content += flatlist + "\n"

	open(MAKEFILE, "wb").write(content.replace("\n", "\r\n"))

def main():
	util2.chdir_top()
	injectDependencyList(flattenDependencyList(createDependencyList()))

if __name__ == "__main__":
	main()
	update_vs.main()
	update_vs2008.main()
		if dependencies[file]:
			opath = getObjectPath(file)
			filename = os.path.splitext(os.path.split(file)[1])[0]
			# TODO: normalizing paths already in prependPath makes getObjectPath fail under cygwin
			deplist = sorted(dependencies[file], key=lambda s: str.lower(s.replace("/", "\\")))
			for depgroup in util2.group(deplist, DEPENDENCIES_PER_LINE):
				flatlist.append("%s\\%s.obj: $B\\%s" % (opath, filename, " $B\\".join(depgroup)))
	return flatlist

def normalizePaths(paths):
	return re.sub(r"( |\\)[^.\\\s]+\\..\\", r"\1", paths.replace("/", "\\"))

def injectDependencyList(flatlist):
	flatlist = "\n".join(sorted(flatlist, key=str.lower))
	flatlist = normalizePaths(flatlist)
	content  = "## Header-dependencies for src\* and src\*\*\n"
	content += "### the list below is auto-generated by update_dependencies.py\n"
	content += "B=$(BASEDIR)\n"
	content += flatlist + "\n"

	open(MAKEFILE, "wb").write(content.replace("\n", "\r\n"))

def main():
	util2.chdir_top()
	injectDependencyList(flattenDependencyList(createDependencyList()))

if __name__ == "__main__":
	main()
	update_vs.main()
	update_vs2008.main()
def update_vs():
	import update_vs
	update_vs.main()