[llvm-commits] [llvm] r143745 - /llvm/trunk/utils/llvm-build/llvmbuild/main.py

Daniel Dunbar daniel at zuster.org
Fri Nov 4 16:40:11 PDT 2011


Author: ddunbar
Date: Fri Nov  4 18:40:11 2011
New Revision: 143745

URL: http://llvm.org/viewvc/llvm-project?rev=143745&view=rev
Log:
llvm-build: Quote colons in target names, in an attempt to make msys happy.

Modified:
    llvm/trunk/utils/llvm-build/llvmbuild/main.py

Modified: llvm/trunk/utils/llvm-build/llvmbuild/main.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm-build/llvmbuild/main.py?rev=143745&r1=143744&r2=143745&view=diff
==============================================================================
--- llvm/trunk/utils/llvm-build/llvmbuild/main.py (original)
+++ llvm/trunk/utils/llvm-build/llvmbuild/main.py Fri Nov  4 18:40:11 2011
@@ -7,6 +7,19 @@
 
 ###
 
+def mk_quote_string_for_target(value):
+    """
+    mk_quote_string_for_target(target_name) -> str
+
+    Return a quoted form of the given target_name suitable for including in a 
+    Makefile as a target name.
+    """
+
+    # The only quoting we currently perform is for ':', to support msys users.
+    return value.replace(":", "\\:")
+
+###
+
 class LLVMProjectInfo(object):
     @staticmethod
     def load_infos_from_path(llvmbuild_source_root):
@@ -427,7 +440,7 @@
 # performance of recursive Make systems.""" 
         print >>f, 'ifeq ($(LLVMBUILD_INCLUDE_DEPENDENCIES),1)'
         print >>f, "# The dependencies for this Makefile fragment itself."
-        print >>f, "%s: \\" % (output_path,)
+        print >>f, "%s: \\" % (mk_quote_string_for_target(output_path),)
         for dep in dependencies:
             print >>f, "\t%s \\" % (dep,)
         print >>f
@@ -438,7 +451,7 @@
 # The dummy targets to allow proper regeneration even when files are moved or
 # removed."""
         for dep in dependencies:
-            print >>f, "%s:" % (dep,)
+            print >>f, "%s:" % (mk_quote_string_for_target(dep),)
         print >>f, 'endif'
 
         f.close()





More information about the llvm-commits mailing list