arm, config: Automatically discover available platforms
[gem5.git] / util / file_types.py
index 85e058db089cc03ef111b52aa73883f542756543..d02bd5f1c088197c1f5e7fc0943d6353330cff63 100644 (file)
@@ -3,6 +3,7 @@ import os
 # lanuage type for each file extension
 lang_types = {
     '.c'     : "C",
+    '.cl'    : "C",
     '.h'     : "C",
     '.cc'    : "C++",
     '.hh'    : "C++",
@@ -30,6 +31,7 @@ lang_types = {
     '.el'    : "lisp",
     '.txt'   : "text",
     '.tex'   : "tex",
+    '.mk'    : "make",
     }
 
 # languages based on file prefix
@@ -140,7 +142,10 @@ def update_file(dst, src, language, mutator):
 
     if isinstance(src, str):
         # if a filename was provided, open the file
-        mode = 'r+' if inplace else 'r'
+        if inplace:
+            mode = 'r+'
+        else:
+            mode = 'r'
         src = file(src, mode)
 
     orig_lines = []