Kbuilds and Makefiles in building the kernel

Abraham Zsombor Nagy <[email protected]> Thu, 27 Nov 2025 11:43:21 +0100
Newsgroups gmane.linux.newbie
Message-ID <[email protected]>
Hello,

https://docs.kernel.org/kbuild/makefiles.html#the-kbuild-files states 
that when a directory contains a Kbuild file, the Makefile is skipped in 
that directory.

It feels to me that both files are in use e.g. under arch/x86/ directory.

I'm trying to see what files are the core of the kernel and what files 
can be configured for x86 by partially parsing the Makefiles and the 
Kbuild files. Would it be sufficient to parse them as:

if file == "Makefile" or file == "Kbuild":

 > parse(file)

or it should prefer the Kbuild file when present, or it is using some 
other logic?

Sincerely,

Abraham Nagy