是的,Bitbake可以通过使用“devshell”来实现仅编译被修改的源代码文件。具体步骤如下:
do_compile_prepend() {
oe_runmake -t ${S} > ${S}/.buildtime.old
}
do_compile() {
# Run the task only if there are files to build
if [ -f ${S}/.buildtime.old ]; then
oe_runmake -q ${S} > /dev/null 2> /dev/null
if [ "$?" != "0" ]; then
oe_runmake -t ${S} > ${S}/.buildtime.new
else
touch ${S}/.buildtime.new
fi
if [ "`cat ${S}/.buildtime.old`" = "`cat ${S}/.buildtime.new`" ]; then
echo "No files were changed; skipping build..."
return
fi
fi
# Compile only modified files
${devshell} make
# Store the build time of the sources
oe_runmake -t ${S} > ${S}/.buildtime.old
}
$ bitbake -c devshell
通过以上方法,Bitbake将会仅编译被修改的源代码文件,从而实现增量编译。