summaryrefslogtreecommitdiff
path: root/make/filter-inputs
diff options
context:
space:
mode:
Diffstat (limited to 'make/filter-inputs')
-rwxr-xr-xmake/filter-inputs25
1 files changed, 25 insertions, 0 deletions
diff --git a/make/filter-inputs b/make/filter-inputs
new file mode 100755
index 00000000..dbae957e
--- /dev/null
+++ b/make/filter-inputs
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+
+#===- make/filter-inputs ---------------------------------------------------===#
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+#===------------------------------------------------------------------------===#
+
+# Given a list of files, return a new list of files taking only the
+# first file for any particular filename.
+def main():
+ import os,sys
+
+ seen = set()
+ for file in sys.argv[1:]:
+ base = os.path.basename(file)
+ if base not in seen:
+ seen.add(base)
+ print file
+
+if __name__ == '__main__':
+ main()