kbuild: Speed up vmlinux build
The recursive build used to do the following: On entering a directory, we would first call make in the subdirectories listed in $(subdir-y), and then call make in the current directory again, with the target 'all_targets'. The second invocation was used to make sure that the subdir makes completed before trying to build the O_TARGET/L_TARGET in the current dir, since this would link in objects in these subdirectories. However, using correct dependencies achieves the same, i.e. just make the objects in $(obj-y) which are not in the local subdirectory depend on 'sub_dirs', which is the rule to descend into subdirs. This patch actually halves the time "make vmlinux" takes when there's nothing to do (which makes sense, as we save half of the make invocations)
Showing
Please register or sign in to comment