I am familiar with make and kbuild, and how the build system work. But I am having hard time understanding how the object goals are built!?
For example, in Kbuild, if you want to generate an object file in a directory you would have a makefile with something like:
obj-$(CONFIG_FOO) += foo.o This evaluates to obj-y/m and adds foo.o to it, and I think that this build file is invoked using submake, then the main makefile would generate all object goals using either obj-y or obj-m (depending how/what you are building),right?
My problem is that usually you can pass from the main makefile/build file to its submake (i.e. export), but the obj-y variable is defined in many places so how is its value being constructed or tracked among all these submake invocations??