Developing the Linux kernel with KDevelop

Alexandre Courbot gnurou at gmail.com
Tue Oct 4 00:45:20 UTC 2011


On Sun, Oct 2, 2011 at 4:40 AM, David Nolden
<david.nolden.kdevelop at art-master.de> wrote:
> Did you try simply pointing the include-path resolver at the correct
> build-directory, so that it determines the include-paths by itself?
> That can be done too within the .kdev_include_paths file, or in the
> GUI which you used to add custom include paths. If this doesn't work,
> then the include-path resolver should be changed so that it also works
> in the kernel.
>
> The include path resolver could also resolve the "-include" file.
>
> Then everything the user would need to do is pointing at the correct
> build directory to get everything working.
>
> Since the kernel even uses Makefiles, I think the "Custom Makefile"
> project-manager is the correct thing to handle this, no? All it would
> need is some additional filtering of the subdirectories. I think some
> filtering would be useful for _all_ project managers, so maybe we
> should pull it up from the generic project manager.

By default, make does not give compilation output with the kernel. It
is possible to get compiler command lines if environment variable V is
set to 1, though. But even if we do that, we may run into another
issue, which is that running make for every single source file on the
kernel is going to require a lot of time. Disabling make invocation in
my checkout of KDevelop dramatically improved parsing time.

Also, even though it stands on top of make, KConfig is a build system
on its own, just like CMake is. Kernel configuration conditions many
things inside the kernel, including which source files should be
compiled, so I think a project manager that is able to parse KConfig
files and automatically resolve the source files that are actually
needed for a selected kernel configuration would be much more
comfortable. In a typical kernel build for embedded systems, 90% of
the source tree is device drivers that are not going to be used and
that we therefore do not want to parse. Without a KConfig manager, one
would have to selectively include/excluse source paths, with it this
could be done automatically.

So although I agree it should be possible to get something that works
reasonnably by tweaking the generic and custom build managers, I think
it is worth (and not so difficult) to bring real KConfig support to
KDevelop and amaze kernel hackers worldwide. ;)

Alex.




More information about the KDevelop-devel mailing list