kbuild: Don't cd into subdirs during build
Instead of using make -C <subdir>, just use make -f <subdir>/Makefile. This means we now call gcc/ld/... always from the topdir. Advantages are: o We don't need to use -I$(TOPDIR)/include and the like, just -Iinclude works. o __FILE__ gives the correct relative path from the topdir instead of an absolute path, as it did before for included headers o gcc errors/warnings give the correct relative path from the topdir o takes us a step closer to a non-recursive build (though that's probably as close as it gets) The changes to Rules.make were done in a way which only uses the new way for the standard recursive build (which remains recursive, just without cd), all the archs do make -C arch/$(ARCH)/boot ..., which should keep working as before. However, of course this should be converted eventually, it's possible to do so piecemeal arch by arch. It seems to work fine for most of the standard kernel. Potential places which need changing are added -I flags to the command line, which now need to have the path relative to the topdir and explicit rules for generating files, which need to properly use $(obj) / $(src) to work correctly.
Showing
Please register or sign in to comment