Unverified Commit 4dec3160 authored by Mohamed Moussa's avatar Mohamed Moussa Committed by Alexander Koskovich
Browse files

common: dlkm: Add parallel jobs for DLKM compilation.

 * Get the number of CPU cores. This is the number of
   parallel jobs to be passed to make command.

Change-Id: I188ebe911d0fb843a6b6f95c25c8e655b1ab9dd6
parent 72868dd9
ifneq ($(KERNEL_MODULES_INSTALL),)
# Get the number of CPU cores. This is the number of parallel jobs to be passed to make command.
NCORES := $(shell grep -c ^processor /proc/cpuinfo)
ifeq ($(NCORES),)
NCORES := 8
endif
DISABLE_THIS_DLKM := $(strip $(TARGET_KERNEL_DLKM_DISABLE))
ifeq ($(DISABLE_THIS_DLKM),true)
......@@ -179,7 +185,7 @@ $(KBUILD_TARGET): kbuild_out_dir := $(KBUILD_OUT_DIR)
$(KBUILD_TARGET): $(TARGET_PREBUILT_INT_KERNEL) $(GKI_TARGET_PREBUILT_KERNEL) $(LOCAL_ADDITIONAL_DEPENDENCIES) $(KBUILD_TARGET_GKI)
@mkdir -p $(kbuild_out_dir)
$(hide) cp -f $(local_path)/Kbuild $(kbuild_out_dir)/Kbuild
$(MAKE) -C $(KERNEL_OUT) M=$(KERNEL_TO_BUILD_ROOT_OFFSET)$(local_path) ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) $(real_cc) $(KERNEL_CFLAGS) modules $(kbuild_options) ANDROID_BUILD_TOP=$$(pwd)
$(MAKE) -j$(NCORES) -C $(KERNEL_OUT) M=$(KERNEL_TO_BUILD_ROOT_OFFSET)$(local_path) ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) $(real_cc) $(KERNEL_CFLAGS) modules $(kbuild_options) ANDROID_BUILD_TOP=$$(pwd)
touch $@
# Define a target to build buildko.timestamp for gki modules as well.
......@@ -197,7 +203,7 @@ ifneq ($(GKI_KERNEL_OUT),)
rm -rf $(kbuild_out_dir)
mkdir -p $(kbuild_out_dir)
$(hide) cp -f $(local_path)/Kbuild $(kbuild_out_dir)/Kbuild
$(MAKE) -C $(GKI_KERNEL_OUT) M=$(KERNEL_TO_BUILD_ROOT_OFFSET)$(local_path) ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) $(real_cc) $(KERNEL_CFLAGS) modules $(kbuild_options_gki) ANDROID_BUILD_TOP=$$(pwd)
$(MAKE) -j$(NCORES) -C $(GKI_KERNEL_OUT) M=$(KERNEL_TO_BUILD_ROOT_OFFSET)$(local_path) ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) $(real_cc) $(KERNEL_CFLAGS) modules $(kbuild_options_gki) ANDROID_BUILD_TOP=$$(pwd)
@mkdir -p $(TARGET_OUT_INTERMEDIATES)/tmp_$(local_module)
mv $(kbuild_out_dir)/* $(TARGET_OUT_INTERMEDIATES)/tmp_$(local_module)
@mkdir -p $(kbuild_out_dir_gki)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment