diff options
Diffstat (limited to 'rakelib')
| -rw-r--r-- | rakelib/compiler.rake | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/rakelib/compiler.rake b/rakelib/compiler.rake index 4731e1d..5cd19d5 100644 --- a/rakelib/compiler.rake +++ b/rakelib/compiler.rake @@ -9,11 +9,11 @@ require 'rake/clean' CLEAN.include 'build/gcc' Rake.application.add_loader('d', Rake::MakefileLoader.new) -FileList['build/gcc/**/*.d'].each { |file| import file } +FileList['build/gcc/obj/**/*.d'].each { |file| import file } -rule(%r{gcc/.+\.o$} => lambda { |file| +rule(%r{gcc/obj/.+\.o$} => lambda { |file| source = Pathname.new('source') + - Pathname.new(file).relative_path_from('build/gcc').sub_ext('.elna') + Pathname.new(file).relative_path_from('build/gcc/obj').sub_ext('.elna') [source, 'build/host/install/bin/gelna'] }) do |t| @@ -23,9 +23,11 @@ rule(%r{gcc/.+\.o$} => lambda { |file| end sources = FileList['source/**/*.elna'].select { |file| file == file.downcase } -file 'build/gcc/elna' => sources.map { |file| - Pathname.new('build/gcc') + +file 'build/gcc/bin/elna' => sources.map { |file| + Pathname.new('build/gcc/obj') + Pathname.new(file).relative_path_from('source').sub_ext('.o') } do |t| + Pathname.new(t.name).dirname.mkpath + sh 'build/host/install/bin/gcc', '-o', t.name, *t.prerequisites end |
