]> granicus.if.org Git - clang/commitdiff
- ccc creates output objects in same directory as the source file, and
authorBill Wendling <isanbard@gmail.com>
Sun, 3 Feb 2008 21:27:46 +0000 (21:27 +0000)
committerBill Wendling <isanbard@gmail.com>
Sun, 3 Feb 2008 21:27:46 +0000 (21:27 +0000)
  not in the current directory. This doesn't work with VPATH builds in
  autotooled builds.
- ccc now creates object files without an extension.
- Return exit code 1 if code > 255.

Patch by Torok!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46689 91177308-0d34-0410-b5e6-96231b3b80d8

utils/ccc

index eff184392da8ae81d40b85afde5a7c22bbc953c2..f902313731ae993a1e38ccfd57e118fa39d56602 100755 (executable)
--- a/utils/ccc
+++ b/utils/ccc
@@ -22,6 +22,8 @@ def run(args):
     cmd = ' '.join(args)
     print >> sys.stderr, cmd
     code = os.system(cmd)
+    if code > 255:
+        code = 1
     if code:
         sys.exit(code)
 
@@ -41,7 +43,11 @@ def changeextension(path, newext):
     i = path.rfind('.')
     if i < 0:
         return path
-    return path[:i] + newext
+    j = path.rfind('/', 0, i)
+    print path
+    if j < 0:
+        return path[:i] + "." + newext
+    return path[j+1:i] + "." + newext
 
 def inferlanguage(extension):
     if extension == "c":