Explorar el Código

audio: uapi: create audio_kernel_headers target

Create a audio_kernel_headers target so that all audio UAPI
header files can be copied to the right target specific OUT
directory and make it easy for clients to mark dependency on
the header files.

Change-Id: I09ca422cbdd067e6e56fff13deaa4e92de3de1fc
Signed-off-by: Banajit Goswami <[email protected]>
Banajit Goswami hace 7 años
padre
commit
65b73c8f02
Se han modificado 2 ficheros con 29 adiciones y 0 borrados
  1. 1 0
      Android.mk
  2. 28 0
      include/uapi/Android.mk

+ 1 - 0
Android.mk

@@ -14,6 +14,7 @@ $(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Modul
 $(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers)
 $(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd934x/Module.symvers)
 
+include $(MY_LOCAL_PATH)/include/uapi/Android.mk
 include $(MY_LOCAL_PATH)/ipc/Android.mk
 include $(MY_LOCAL_PATH)/dsp/Android.mk
 include $(MY_LOCAL_PATH)/dsp/codecs/Android.mk

+ 28 - 0
include/uapi/Android.mk

@@ -0,0 +1,28 @@
+# Use this by setting
+#   LOCAL_HEADER_LIBRARIES := audio_kernel_headers
+
+LOCAL_PATH := $(call my-dir)
+MYLOCAL_PATH := $(LOCAL_PATH)
+
+UAPI_OUT := $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/include
+
+AUDIO_KERNEL_HEADERS := $(call all-named-files-under,*.h,linux) $(call all-named-files-under,*.h,sound)
+
+HEADER_INSTALL_DIR := kernel/msm-$(TARGET_KERNEL_VERSION)/scripts
+
+BUILD_ROOT_RELATIVE := ../../../../../../../
+
+include $(CLEAR_VARS)
+LOCAL_MODULE                  := audio_kernel_headers
+LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_PREBUILT_INT_KERNEL)
+
+GEN := $(addprefix $(UAPI_OUT)/,$(AUDIO_KERNEL_HEADERS))
+$(GEN): PRIVATE_PATH := $(MYLOCAL_PATH)
+$(GEN): PRIVATE_CUSTOM_TOOL = $(shell cd $(PRODUCT_OUT)/obj/KERNEL_OBJ; $(BUILD_ROOT_RELATIVE)$(HEADER_INSTALL_DIR)/headers_install.sh $(BUILD_ROOT_RELATIVE)$(dir $@) $(BUILD_ROOT_RELATIVE)$(subst $(UAPI_OUT),$(MYLOCAL_PATH),$(dir $@)) $(notdir $@))
+$(GEN): $(addprefix $(MYLOCAL_PATH)/,$(AUDIO_KERNEL_HEADERS))
+	$(transform-generated-source)
+
+LOCAL_GENERATED_SOURCES := $(GEN)
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(UAPI_OUT)
+
+include $(BUILD_HEADER_LIBRARY)