$(LLVM_CONFIGS) \
$(S)src/etc/mklldeps.py
$(Q)$(CFG_PYTHON) $(S)src/etc/mklldeps.py \
- "$(LLVM_COMPONENTS)" $(LLVM_CONFIGS) \
- > $@
+ "$@" "$(LLVM_COMPONENTS)" $(LLVM_CONFIGS)
$(foreach host,$(CFG_HOST), \
$(eval $(call DEF_LLVM_RULES,$(host))))
import sys
import subprocess
-components = sys.argv[1].split(' ')
+f = open(sys.argv[1], 'wb')
-print """// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+components = sys.argv[2].split(' ')
+
+f.write("""// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// WARNING: THIS IS A GENERATED FILE, DO NOT MODIFY
// take a look at src/etc/mklldeps.py if you're interested
-"""
+""")
-for llconfig in sys.argv[2:]:
- print
+for llconfig in sys.argv[3:]:
+ f.write("\n")
proc = subprocess.Popen([llconfig, '--host-target'], stdout = subprocess.PIPE)
out, err = proc.communicate()
"target_os = \"" + os + "\"",
]
- print "#[cfg(" + ', '.join(cfg) + ")]"
+ f.write("#[cfg(" + ', '.join(cfg) + ")]\n")
args = [llconfig, '--libs']
args.extend(components)
for lib in out.strip().split(' '):
lib = lib[2:] # chop of the leading '-l'
- print "#[link(name = \"" + lib + "\", kind = \"static\")]"
+ f.write("#[link(name = \"" + lib + "\", kind = \"static\")]\n")
if os == 'win32':
- print "#[link(name = \"imagehlp\")]"
- print "extern {}"
+ f.write("#[link(name = \"imagehlp\")]\n")
+ f.write("extern {}\n")