Open garandria opened 2 years ago
The most accurate way to get the list of all files would be to just build the kernel for the given .config file. The Makefiles even have a verbose flag to print all the gcc commands, i.e., make V=1
. For small builds, this could be pretty fast, though large builds, e.g., allyesconfig, could be hours on a commodity machine. You might be able to replace the gcc command with an bash script that calls echo or something like that to avoid actually building, though this may break the build.
In kmax, there is no specific command-line flag for doing this using constraint solving. It is technically possible, though, by using kmaxall
to get the Kbuild constraints for all .o files, using kclause
to get the Kconfig constraints, then for each .o file, check whether the .config file satisfies both the Kbuild and Kconfig constraints. This may also be slow though, given the many satisfiability checks. Also, the constraints aren't perfect, e.g., Kconfig underapproximates non-Boolean configuration options, so technically you could get .o files satisfied that wouldn't actually get built.
Let me know if make V=1
isn't enough and if the limitations of using kmax for this are acceptable and then I can put this feature on the roadmap.
Thank you for answer. I have been using make V=1
and other Make's debug information to do it. I wanted to know if it is possible to get the list of all .o files without compiling the kernel by just inferring information from Kbuild. Make has the --just-print
flag to only print what it would do without running the commands but it fails at some point for Linux.
Okay I understand. I will keep this on the list of TODOs.
Just to double-check, is it that it takes too long to compile the kernel, and this is why you'd like to use kmax to find which files there are?
Given a .config, I would like to have the list of all .o or .c files that will be compiled.
Can Kmax dump all the sources or compilation units that will be included in the compilation of a given configuration by reading makefiles?