diff --git a/Rakefile b/Rakefile index 246849612..0a821d7ce 100755 --- a/Rakefile +++ b/Rakefile @@ -200,7 +200,8 @@ rule '.o' => '.rc' do |t| end rule '.h' => '.png' do |t| - runq " BIN2H #{t.source}", "#{c(:top_srcdir)}/rake.d/bin/bin2h.rb #{t.source} #{t.name}" + puts " BIN2H #{t.source}" if !ENV['V'].to_bool + bin2h t.source, t.name end # Resources depend on the manifest.xml file for Windows builds. diff --git a/rake.d/bin/bin2h.rb b/rake.d/bin/bin2h.rb deleted file mode 100755 index 3f669dca4..000000000 --- a/rake.d/bin/bin2h.rb +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env ruby - -if ARGV.size != 2 - puts "Syntax: bin2h.rb source.ext destination.h" - exit 1 -end - -bin_name = File.basename(ARGV[0]).gsub(/[^a-z\d]/i, '_').gsub(/_+/, '_') + '_bin' - -File.open(ARGV[1], "w") do |file| - file.puts < !verbose) end +def bin2h bin_file_name, h_file_name + bin_name = File.basename(bin_file_name).gsub(/[^a-z\d]/i, '_').gsub(/_+/, '_') + '_bin' + + File.open(h_file_name, "w") do |file| + file.puts <