Commit 3254cafe authored by Rashed Abdel-Tawab's avatar Rashed Abdel-Tawab

kernel: Add TARGET_KERNEL_ADDITIONAL_FLAGS to allow setting extra cflags

Also fix KERNEL_MAKE_FLAGS not being used by the kernel make command

Change-Id: I8786d6c1de6652f87a02c990c4b56f62b0cc0203
parent f5814560
......@@ -193,7 +193,7 @@ KERNEL_ADDITIONAL_CONFIG_OUT := $(KERNEL_OUT)/.additional_config
# $(1): output path (The value passed to O=)
# $(2): target to build (eg. defconfig, modules, dtbo.img)
define internal-make-kernel-target
$(PATH_OVERRIDE) $(MAKE) -C $(KERNEL_SRC) O=$(1) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(KERNEL_CLANG_TRIPLE) $(KERNEL_CC) $(2)
$(PATH_OVERRIDE) $(MAKE) $(KERNEL_MAKE_FLAGS) -C $(KERNEL_SRC) O=$(1) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(KERNEL_CLANG_TRIPLE) $(KERNEL_CC) $(2)
endef
# Make a kernel target
......
......@@ -20,6 +20,7 @@
#
# TARGET_KERNEL_SOURCE = Kernel source dir, optional, defaults
# to kernel/$(TARGET_DEVICE_DIR)
# TARGET_KERNEL_ADDITIONAL_FLAGS = Additional make flags, optional
# TARGET_KERNEL_ARCH = Kernel Arch
# TARGET_KERNEL_CROSS_COMPILE_PREFIX = Compiler prefix (e.g. arm-eabi-)
# defaults to arm-linux-androidkernel- for arm
......@@ -115,6 +116,10 @@ ifeq ($(HOST_OS),darwin)
KERNEL_MAKE_FLAGS += LIBRARY_PATH=/usr/local/opt/openssl/lib
endif
ifneq ($(TARGET_KERNEL_ADDITIONAL_FLAGS),)
KERNEL_MAKE_FLAGS += $(TARGET_KERNEL_ADDITIONAL_FLAGS)
endif
# Set DTBO image locations so the build system knows to build them
ifeq ($(TARGET_NEEDS_DTBOIMAGE),true)
BOARD_PREBUILT_DTBOIMAGE ?= $(PRODUCT_OUT)/dtbo/arch/$(KERNEL_ARCH)/boot/dtbo.img
......
Markdown is supported
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