-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrakefile.rb
50 lines (38 loc) · 1.54 KB
/
rakefile.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
require 'ceedling'
Ceedling.load_project
# The location of the compiled TivaWare Peripheral Driver Library.
driverlib = "lib/TivaWare/driverlib/gcc/libdriver.a"
# Run all tests and build the release by default.
task :default => %w[ test:all release ]
# The release build requires driverlib to be built first.
task :release => "#{driverlib}"
desc "A release task that also creates the bin file"
task :release_bin => [:release, "#{PROJECT_BUILD_ROOT}/release/project.bin"]
file "#{PROJECT_BUILD_ROOT}/release/project.bin" => :release do |task|
puts "Creating #{File.basename(task.name)}..."
sh "arm-none-eabi-objcopy -O binary #{PROJECT_BUILD_ROOT}/release/#{RELEASE_BUILD_OUTPUT} #{task.name}"
end
desc "Load the binary onto the Tiva C Launchpad board"
task :load => "#{PROJECT_BUILD_ROOT}/release/project.bin" do
puts "Loading to board..."
sh "lm4flash #{PROJECT_BUILD_ROOT}/release/project.bin"
end
# Build instructions for the TivaWare Peripheral Driver Library (i.e. "driverlib").
namespace :driverlib do
driverlib_src_path = "lib/TivaWare/driverlib"
desc "Build TivaWare Peripheral Driver Library"
task :build => "#{driverlib}"
file "#{driverlib}" do |task|
puts "Building #{File.basename(task.name)}..."
chdir("#{driverlib_src_path}") do
sh "make"
end
end
desc "Clean TivaWare Peripheral Driver Library"
task :clean do |task|
puts "Cleaning #{File.basename(task.name)}..."
chdir("#{driverlib_src_path}") do
sh "make clean"
end
end
end