Skip to content

Commit

Permalink
Fixed bug that would prevent the kernel from being re-linked when a f…
Browse files Browse the repository at this point in the history
…ile in the generic/ folder was being updated.
  • Loading branch information
perlun committed Feb 28, 2015
1 parent 22b1f87 commit b686d54
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions storm/ia32/Rakefile
Expand Up @@ -33,6 +33,10 @@ OBJECTS = %w(
)

OUTPUT = 'libstorm_ia32.a'

# TODO: Would like to use STORM_GENERIC_LIB, but for whatever reason it is not available in this context.
GENERIC_OUTPUT = '../generic/libstorm_generic.a'

KERNEL_OUTPUT = 'storm'
LDFLAGS = '-nostdlib -Wl,-T,kernel.ld -m32'

Expand All @@ -51,13 +55,13 @@ task :install do
puts " Installed #{KERNEL_OUTPUT} in #{INSTALL_ROOT}".gray
end

file KERNEL_OUTPUT => [ OUTPUT ] do |t|
file KERNEL_OUTPUT => [ OUTPUT, GENERIC_OUTPUT ] do |t|
begin
puts ' Linking...'.blue.bold

# It's crazy, but we actually have to specify the OUTPUT twice here (since ia32 has references to the generic lib and
# the generic lib has references to ia32... We could try to get rid of that eventually.)
command = "#{CC} -o #{t.name} #{OUTPUT} ../generic/#{STORM_GENERIC_LIB} #{OUTPUT} #{LDFLAGS}"
command = "#{CC} -o #{t.name} #{OUTPUT} #{GENERIC_OUTPUT} #{OUTPUT} #{LDFLAGS}"
sh command
rescue
puts "Error linking kernel. Full command line was: #{command}"
Expand Down

0 comments on commit b686d54

Please sign in to comment.