Rakefile: automatically get libopencm3
This commit is contained in:
parent
510c82d00f
commit
374aaacea5
13
Rakefile
13
Rakefile
|
@ -28,6 +28,11 @@ end
|
||||||
LIBOPENCM3_DIR = "libopencm3"
|
LIBOPENCM3_DIR = "libopencm3"
|
||||||
LIBOPENCM3_INC = LIBOPENCM3_DIR+"/include"
|
LIBOPENCM3_INC = LIBOPENCM3_DIR+"/include"
|
||||||
LIBOPENCM3_LIBS = LIBOPENCM3_DIR+"/lib"
|
LIBOPENCM3_LIBS = LIBOPENCM3_DIR+"/lib"
|
||||||
|
# get libopencm3
|
||||||
|
unless File.file?("./#{LIBOPENCM3_DIR}/scripts/genlink.py") then
|
||||||
|
sh "git submodule init"
|
||||||
|
sh "git submodule update"
|
||||||
|
end
|
||||||
LIBOPENCM3_LIB = "opencm3_" + `./#{LIBOPENCM3_DIR}/scripts/genlink.py #{LIBOPENCM3_DIR}/ld/devices.data #{DEVICE} FAMILY`
|
LIBOPENCM3_LIB = "opencm3_" + `./#{LIBOPENCM3_DIR}/scripts/genlink.py #{LIBOPENCM3_DIR}/ld/devices.data #{DEVICE} FAMILY`
|
||||||
|
|
||||||
# source code used by the firmware
|
# source code used by the firmware
|
||||||
|
@ -137,14 +142,8 @@ def dependencies(source, done=[])
|
||||||
return done
|
return done
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "get libopencm3"
|
|
||||||
file LIBOPENCM3_DIR+"/Makefile" do
|
|
||||||
sh "git submodule init"
|
|
||||||
sh "git submodule update"
|
|
||||||
end
|
|
||||||
|
|
||||||
desc "compile libopencm3"
|
desc "compile libopencm3"
|
||||||
file "#{LIBOPENCM3_LIBS}/lib#{LIBOPENCM3_LIB}.a" => LIBOPENCM3_DIR+"/Makefile" do
|
file "#{LIBOPENCM3_LIBS}/lib#{LIBOPENCM3_LIB}.a" do
|
||||||
sh "make --directory #{LIBOPENCM3_DIR}"
|
sh "make --directory #{LIBOPENCM3_DIR}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue