summaryrefslogtreecommitdiffstats
path: root/core/binary.mk
diff options
context:
space:
mode:
authorScott Mertz <scott@cyngn.com>2016-06-01 13:40:25 -0700
committerScott Mertz <scott@cyngn.com>2016-06-03 08:09:31 -0700
commit0bf14034d6d724cd426f65a8917988b5459251c8 (patch)
tree25bf75202d161d091bf2480ff1a7a738c3336cad /core/binary.mk
parent96170ade9b7c48d7241e9a8b0d975c835dd961a1 (diff)
downloadbuild-0bf14034d6d724cd426f65a8917988b5459251c8.tar.gz
build-0bf14034d6d724cd426f65a8917988b5459251c8.tar.bz2
build-0bf14034d6d724cd426f65a8917988b5459251c8.zip
build: add kernel header dependency if module uses kernel headers
Many of the QCOM components use kernel headers, but don't declare the dependency on them. This is fine in CAF because of the way they build the boot.img before anything else. In CM, we don't build the boot.img the same, so we run into a race between the kernel build & these modules... and the modules lose. Warn about modules that have this missing dependency, and add it for them so we don't have to modify each Android.mk. Change-Id: I95f1e47b5ef440f6f5d8f64a0c3f38d9572e839e
Diffstat (limited to 'core/binary.mk')
-rw-r--r--core/binary.mk9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/binary.mk b/core/binary.mk
index 77612ad2e..7610dce8b 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -30,6 +30,15 @@ else
endif
endif
+# Many qcom modules don't correctly set a dependency on the kernel headers. Fix it for them,
+# but warn the user.
+ifneq (,$(findstring $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include,$(LOCAL_C_INCLUDES)))
+ ifeq (,$(findstring $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr,$(LOCAL_ADDITIONAL_DEPENDENCIES)))
+ $(warning $(LOCAL_MODULE) uses kernel headers, but does not depend on them!)
+ LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
+ endif
+endif
+
# The following LOCAL_ variables will be modified in this file.
# Because the same LOCAL_ variables may be used to define modules for both 1st arch and 2nd arch,
# we can't modify them in place.