Rakefile: better libopencm3 dependency dectection

This commit is contained in:
King Kévin 2017-10-04 14:25:34 +02:00
parent d1d9927267
commit 2c8e872d89
1 changed files with 4 additions and 4 deletions

View File

@ -143,13 +143,13 @@ task :doc => ["Doxyfile", "README.md"] do |t|
end
desc "compile source into object"
rule '.o' => '.c' do |t|
sh "#{CC} #{cflags} #{archflags} -o #{t.name} -c #{t.source}"
rule '.o' => ['.c', "#{LIBOPENCM3_LIB}/lib#{STM32F1_LIB}.a"] do |t|
sh "#{CC} #{cflags} #{archflags} -o #{t.name} -c #{t.prerequisites[0]}"
end
desc "generate dependencies"
rule '.d' => '.c' do |t|
sh "#{CC} #{cflags} #{archflags} -MM -MF #{t.name} -c #{t.source}"
rule '.d' => ['.c', "#{LIBOPENCM3_LIB}/lib#{STM32F1_LIB}.a"] do |t|
sh "#{CC} #{cflags} #{archflags} -MM -MF #{t.name} -c #{t.prerequisites[0]}"
end
desc "link binary"