Created
April 5, 2017 10:05
-
-
Save Wonicon/dfda3616bc7354b98625a746ce4bb635 to your computer and use it in GitHub Desktop.
gem5 benchmarks cocurrent control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Uage: <script> <runscripts> <makefile> | |
runscripts = File.read(ARGV[0]) | |
makefile = File.open(ARGV[1], 'w') | |
configs = runscripts.each_line.map{ |line| line.split(' ')[4].split('/')[-1] } | |
makefile.puts("task := #{configs.map{ |c| "finish.#{c}" }.join(' ')}") | |
makefile.puts | |
makefile.puts("default: $(task)") | |
makefile.puts | |
runscripts.each_line.zip(configs) do |line, config| | |
target = "finish.#{config}" | |
makefile.puts("#{target}:") | |
makefile.puts("\t#{line}") | |
makefile.puts("\ttouch #{target}") | |
makefile.puts | |
end | |
makefile.puts("clean:") | |
makefile.puts("\trm finish.* stdout/nohup.*") | |
makefile.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment