From 43519dca0af26a2810bbbd6c389928979d9d896c Mon Sep 17 00:00:00 2001 From: Jon Medhurst Date: Tue, 10 Apr 2012 18:41:18 +0100 Subject: tasks/kernel.mk: Conditionally build out-of-tree gator module For the linux-linaro tree the Gator module will be in the kernel tree. Therefore make the rule for building the out-of-tree module conditional on the presence of the external source code. This change doesn't attempt to handle in-tree gator modules built with TARGET_GATOR_WITH_MALI_SUPPORT. We will leave that until we have such a case as the linux-linaro single tree may lead to some consolidation of Mali drivers. Change-Id: I03facdc6cae768409887f9a6cb46b28e2ae96fec Signed-off-by: Jon Medhurst --- tasks/kernel.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tasks/kernel.mk b/tasks/kernel.mk index 23a0f50..3413e22 100644 --- a/tasks/kernel.mk +++ b/tasks/kernel.mk @@ -49,6 +49,7 @@ GATOR_EXTRA_CFLAGS += -DMALI_SUPPORT=$(TARGET_GATOR_WITH_MALI_SUPPORT) -I$(KERNE GATOR_EXTRA_MAKE_ARGS += GATOR_WITH_MALI_SUPPORT=$(TARGET_GATOR_WITH_MALI_SUPPORT) endif +ifneq ($(realpath $(TOP)/external/gator/driver),) gator_driver: android_kernel_modules $(INSTALLED_KERNEL_TARGET) $(ACP) cd $(TOP)/external/gator/driver &&\ if [ -e $(KERNEL_TOOLS_PREFIX)ld.bfd ]; then LD=$(KERNEL_TOOLS_PREFIX)ld.bfd; else LD=$(KERNEL_TOOLS_PREFIX)ld; fi && \ @@ -56,6 +57,10 @@ gator_driver: android_kernel_modules $(INSTALLED_KERNEL_TARGET) $(ACP) $(MAKE) O=$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=$(KERNEL_TOOLS_PREFIX) LD=$$LD EXTRA_CFLAGS="$(EXTRA_CFLAGS) -fno-pic $(GATOR_EXTRA_CFLAGS)" KCFLAGS="$(TARGET_EXTRA_CFLAGS) -fno-pic $(LOCAL_CFLAGS)" $(GATOR_EXTRA_MAKE_ARGS) -C $(KERNEL_PATH) M=`pwd` modules mkdir -p $(TARGET_OUT)/modules find $(TOP)/external/gator/driver/. -name "*.ko" -exec $(ACP) -fpt {} $(TARGET_OUT)/modules/ \; +else +gator_driver: +endif + else gator_driver: endif -- cgit v1.2.3