I didn't test your approach. Also your approach would force parallel build everywhere, even at possibly undesired places.
My approach just extends existing mechanism. On Tue, Aug 30, 2011 at 11:13, Florian Fainelli <[email protected]> wrote: > Hello, > > On Monday 29 August 2011 22:11:52 [email protected] wrote: > > From: "Eugene San (eugenesan)" <[email protected]> > > > > > > Signed-off-by: Eugene San (eugenesan) <[email protected]> > > --- > > Config.in | 13 +++++++++++++ > > include/kernel-defaults.mk | 6 ++++-- > > 2 files changed, 17 insertions(+), 2 deletions(-) > > We already support building the kernel and modules in parallel when make is > invoked with a given number of jobs from the top-level directory of > OpenWrt. > Did not you have it working? > > > > > diff --git a/Config.in b/Config.in > > index f36221c..f4dbf80 100644 > > --- a/Config.in > > +++ b/Config.in > > @@ -307,6 +307,19 @@ menu "Global build settings" > > If you say Y, toolchain build might break. > > Before reporting build bugs, set this to N and re-run the > build. > > > > + config KERNEL_PARALLEL > > + bool > > + prompt "Parallelize the kernel build (May break build)" > > + depends on PKG_BUILD_PARALLEL > > + default n > > + help > > + Build the kernel with parallel make jobs. > > + This speeds up the kernel build on SMP machines, but may > > + break the build for certain toolchain versions. > > + > > + If you say Y, kernel build might break. > > + Before reporting build bugs, set this to N and re-run the > build. > > + > > comment "Stripping options" > > > > choice > > diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk > > index 5fd27ae..b637577 100644 > > --- a/include/kernel-defaults.mk > > +++ b/include/kernel-defaults.mk > > @@ -5,6 +5,8 @@ > > # See /LICENSE for more information. > > # > > > > +KERNEL_JOBS?=$(if $(CONFIG_KERNEL_PARALLEL),-j$(CONFIG_PKG_BUILD_JOBS)) > > + > > KERNEL_MAKEOPTS := -C $(LINUX_DIR) \ > > CROSS_COMPILE="$(KERNEL_CROSS)" \ > > ARCH="$(LINUX_KARCH)" \ > > @@ -93,14 +95,14 @@ endef > > > > define Kernel/CompileModules/Default > > rm -f $(LINUX_DIR)/vmlinux $(LINUX_DIR)/System.map > > - +$(MAKE) $(KERNEL_MAKEOPTS) modules > > + +$(MAKE) $(KERNEL_MAKEOPTS) $(KERNEL_JOBS) modules > > endef > > > > OBJCOPY_STRIP = -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R > > .note.gnu.build-id > > > > define Kernel/CompileImage/Default > > $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),,rm -f $(TARGET_DIR)/init) > > - +$(MAKE) $(KERNEL_MAKEOPTS) $(KERNELNAME) > > + +$(MAKE) $(KERNEL_MAKEOPTS) $(KERNEL_JOBS) $(KERNELNAME) > > $(KERNEL_CROSS)objcopy -O binary $(OBJCOPY_STRIP) -S > $(LINUX_DIR)/vmlinux > > $(LINUX_KERNEL) $(KERNEL_CROSS)objcopy $(OBJCOPY_STRIP) -S > > $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux.elf endef > > -- > Florian >
_______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
