summaryrefslogtreecommitdiffstats
path: root/Tools/Python
diff options
context:
space:
mode:
authorbbahnsen <bbahnsen@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-11 00:14:05 +0000
committerbbahnsen <bbahnsen@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-11 00:14:05 +0000
commitb23e12fab83e06b0edabd6360552d4bb0b0d4de8 (patch)
tree160eff5cc567e28e53e78927e098e906909b8dab /Tools/Python
parentfd73932fec502f5f03659a2a846e30a0b3716d0a (diff)
downloadedk2-b23e12fab83e06b0edabd6360552d4bb0b0d4de8.tar.gz
edk2-b23e12fab83e06b0edabd6360552d4bb0b0d4de8.tar.bz2
edk2-b23e12fab83e06b0edabd6360552d4bb0b0d4de8.zip
Print a descriptive error message if the msa file is ambiguous.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2214 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Python')
-rwxr-xr-xTools/Python/GenMake.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/Tools/Python/GenMake.py b/Tools/Python/GenMake.py
index 39f0926380..d4deffc2d2 100755
--- a/Tools/Python/GenMake.py
+++ b/Tools/Python/GenMake.py
@@ -49,7 +49,7 @@ def doLib(msafile, arch):
"""Create a directory with the sources, AutoGen.h and a makefile."""
- sources = []
+ objects = []
msa = xml.dom.minidom.parse(inMde(msafile))
libName = str(XmlElement(msa, "/ModuleSurfaceArea/MsaHeader/ModuleName"))
@@ -72,9 +72,14 @@ def doLib(msafile, arch):
toolchain = sourceFile.getAttribute("ToolChainFamily")
base, ext = os.path.splitext(sourceFileName)
- if ( suppArchs == [""] or arch in suppArchs) and (ext in [".c", ".h", ".S"] or toolchain in ["GCC"]):
+ if ( suppArchs == [""] or arch in suppArchs) and toolchain in ["", "GCC"] and ext in [".c", ".h", ".S"]:
if ext in [".c", ".S"]:
- sources.append(str(base+".o"))
+ obj = str(base+".o")
+ if obj in objects:
+ print "Error: The msa file %s is ambigous. There are mutliple sources that can produce the object file %s. Please fix it." % (msafile, obj)
+ sys.exit()
+ else:
+ objects.append(obj)
sourceDir = os.path.join(libName, os.path.dirname(sourceFileName))
mkdir(sourceDir)
mkdir(os.path.join(buildDir, os.path.dirname(sourceFileName)))
@@ -84,7 +89,7 @@ def doLib(msafile, arch):
# Write a Makefile for this module
f = open(os.path.join(buildDir, "Makefile"), "w")
- f.write(Makefile.substitute(ARCH=arch, LIBNAME=libName, OBJECTS=string.join(sources, " ")))
+ f.write(Makefile.substitute(ARCH=arch, LIBNAME=libName, OBJECTS=string.join(objects, " ")))
f.close()
# Right now we are getting the AutoGen.h file from a previous build. We