Re: [RFC] Kbuild: allow code re-use across different directories

From: Cong Wang
Date: Mon Aug 22 2011 - 04:43:08 EST


ä 2011å08æ20æ 08:37, Arnaud Lacombe åé:
Hi folks,

The attached patch modify Kbuild to allow to directly re-use code in multiple
directory without having to go through a copy. Technically, it changes Kbuild to
use by default the VPATH feature of GNU make and provides accessors for Makefile
to change it indirectly.
...

With the attached patch, we would do:

arch/foo/boot/Makefile:
LDFLAGS_fancy.o := -DPANTS=30
obj-y += fancy.o
vpath-y += $(srctree)/arch/foo/lib

and let GNU make do the job.

Just note that don't forget to update Documentation/kbuild/makefiles.txt. ;)

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/