On Thu, Dec 10, 2015 at 09:44:45AM +0200, Tomi Valkeinen wrote: > Hi Sam, > > On 09/12/15 23:32, Sam Ravnborg wrote: > > > kbuild may enter a sub directory for two purposes: > > 1) to build object files to be part of the final image > > Only subdirs specified using obj-y is visited. > > > > 2) to build object files that will be included in a module > > Subdirs specified with obj-y and obj-m is visited > > > > Since you have the following code in your Makefile: > > > > obj-m += foo/ > > > > then foo/ is only visited to build modules. > > > > So bar.o is built but is NOT included in the final image. > > This is also the behaviour you see. > > Right. > > We have three drivers (one fbdev, two drm), each of which can be built > as a module. But each of them also may require small boot-time setup, > which needs to be built-in. > > I can get around the problem by entering the dir with obj-y, or by > creating a new extra config define which is y/n, and using that in the > makefile. The former makes make enter the dir even if the driver is not > enabled, and latter creates a config symbol only to solve this problem. The extra config symbol is the most elegant solution here IMO. Make sure to document that this config symbol enables the boot-time setup stuff. Sam -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html