Skip to content
Snippets Groups Projects
Verified Commit 53ef7375 authored by Beru Hinode's avatar Beru Hinode
Browse files

kernel: Initial implementation of `TARGET_KERNEL_BUILD_THREADS`


* Utilizing `KERNEL_MAKE_FLAGS` variable in its core and working
  exactly the same way as if it's defined in
  `TARGET_KERNEL_ADDITIONAL_FLAGS`, this variable simply sets the
  threads used during kernel compilation, resulting in a way less
  time consumed for the kernel build process. It's optional to use
  this variable and it's defaulted to 1. The need for this change is
  basically coming from some mid-low-end machines that are (ab)used
  to build Android ROMs, such as a machine with 3rd gen Intel Core i3
  that took an entirety of 14 hours to clean build.

Test: `m bootimage`, kernel uses configured thread count and takes
      less time to build.
Signed-off-by: default avatarBeru Hinode <windowz414@1337.lgbt>
parent 6823d249
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
# These config vars are usually set in BoardConfig.mk: # These config vars are usually set in BoardConfig.mk:
# #
# TARGET_KERNEL_ADDITIONAL_FLAGS = Additional make flags, optional # TARGET_KERNEL_ADDITIONAL_FLAGS = Additional make flags, optional
# TARGET_KERNEL_BUILD_THREADS = Thread count used for building kernel, optional, defaults to 4
# TARGET_KERNEL_CONFIG = List of kernel defconfigs, first one being the base one, # TARGET_KERNEL_CONFIG = List of kernel defconfigs, first one being the base one,
# while all the others are fragments that will be merged # while all the others are fragments that will be merged
# to main one in .config. # to main one in .config.
...@@ -243,6 +244,9 @@ ifneq ($(TARGET_KERNEL_ADDITIONAL_FLAGS),) ...@@ -243,6 +244,9 @@ ifneq ($(TARGET_KERNEL_ADDITIONAL_FLAGS),)
KERNEL_MAKE_FLAGS += $(TARGET_KERNEL_ADDITIONAL_FLAGS) KERNEL_MAKE_FLAGS += $(TARGET_KERNEL_ADDITIONAL_FLAGS)
endif endif
TARGET_KERNEL_BUILD_THREADS ?= 1
KERNEL_MAKE_FLAGS += -j$(TARGET_KERNEL_BUILD_THREADS)
# Internal implementation of make-kernel-target # Internal implementation of make-kernel-target
# $(1): output path (The value passed to O=) # $(1): output path (The value passed to O=)
# $(2): target to build (eg. defconfig, modules, dtbo.img) # $(2): target to build (eg. defconfig, modules, dtbo.img)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment