Makefile.am 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. AUDIO_ROOT=$(PWD)
  2. UAPI_OUT=$(PWD)
  3. HEADER_INSTALL_DIR=$(KERNEL_SRC)/scripts
  4. KERNEL_BINARY_DIR=$(KERNEL_SRC)/../kernel-build-artifacts
  5. KBUILD_OPTIONS := AUDIO_ROOT=$(PWD)
  6. KBUILD_OPTIONS += MODNAME=audio
  7. KBUILD_OPTIONS += UAPI_OUT=$(PWD)
  8. AUDIO_KERNEL_HEADERS_PATH1 = $(shell ls ./include/uapi/audio/linux/*.h)
  9. AUDIO_KERNEL_HEADERS_PATH2 = $(shell ls ./include/uapi/audio/linux/mfd/wcd9xxx/*.h)
  10. AUDIO_KERNEL_HEADERS_PATH3 = $(shell ls ./include/uapi/audio/sound/*.h)
  11. ifeq ($(TARGET_SUPPORT),qcs40x)
  12. KBUILD_OPTIONS += CONFIG_ARCH_QCS405=y
  13. endif
  14. ifeq ($(TARGET_SUPPORT), sdmsteppe)
  15. KBUILD_OPTIONS += CONFIG_ARCH_SM6150=y
  16. endif
  17. ifeq ($(TARGET_SUPPORT), sdxlemur))
  18. KBUILD_OPTIONS += CONFIG_ARCH_SDXLEMUR=y
  19. endif
  20. subdir-ccflags-y += -I$(AUDIO_ROOT)/include/uapi/
  21. subdir-ccflags-y += -I$(AUDIO_ROOT)/include/uapi/
  22. obj-m := ipc/
  23. obj-m += dsp/
  24. obj-m += soc/
  25. obj-m += asoc/
  26. obj-m += asoc/codecs/
  27. ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sdmsteppe sdxlemur))
  28. obj-m += asoc/codecs/wcd934x/
  29. endif
  30. ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), qcs40x))
  31. obj-m += asoc/codecs/bolero/
  32. obj-m += asoc/codecs/csra66x0/
  33. obj-m += asoc/codecs/ep92/
  34. endif
  35. ifeq ($(TARGET_SUPPORT), sdmsteppe)
  36. obj-m += asoc/codecs/bolero/
  37. obj-m += asoc/codecs/wcd937x/
  38. endif
  39. ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sa8155 sa8155ivi sa6155 sa8195 qtiquingvm))
  40. KBUILD_OPTIONS += CONFIG_SND_SOC_AUTO=y
  41. obj-m := ipc/
  42. obj-m += dsp/
  43. obj-m += asoc/
  44. obj-m += asoc/codecs/
  45. obj-m += soc/
  46. ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sa8155 sa8155ivi sa8195 qtiquingvm))
  47. KBUILD_OPTIONS += CONFIG_SND_SOC_SA8155=m
  48. endif
  49. ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sa6155))
  50. KBUILD_OPTIONS += CONFIG_SND_SOC_SA6155=m
  51. endif
  52. endif
  53. define PROCESS_HEADERS
  54. $(foreach name,$(1),$(shell cd $(KERNEL_BINARY_DIR) && $(KERNEL_SRC)/scripts/headers_install.sh $(2)$(name) $(3)$(name)))
  55. endef
  56. all:
  57. $(shell rm -fr $(shell pwd)/soc/core.h)
  58. $(shell ln -s $(KERNEL_SRC)/drivers/pinctrl/core.h $(shell pwd)/soc/core.h)
  59. $(shell rm -fr $(shell pwd)/include/soc/internal.h)
  60. $(shell ln -s $(KERNEL_SRC)/drivers/base/regmap/internal.h $(shell pwd)/include/soc/internal.h)
  61. $(shell rm -fr $(shell pwd)/soc/pinctrl-utils.h)
  62. $(shell ln -s $(KERNEL_SRC)/drivers/pinctrl/pinctrl-utils.h $(shell pwd)/soc/pinctrl-utils.h)
  63. $(shell rm -fr $(shell pwd)/include/soc/qcom/secure_buffer.h)
  64. $(shell ln -s $(KERNEL_SRC)/include/soc/qcom/secure_buffer.h $(shell pwd)/include/soc/qcom/secure_buffer.h)
  65. $(shell mkdir $(shell pwd)/linux)
  66. $(shell mkdir $(shell pwd)/sound)
  67. $(shell mkdir $(shell pwd)/linux/mfd)
  68. $(shell mkdir $(shell pwd)/linux/mfd/wcd9xxx)
  69. $(call PROCESS_HEADERS, $(notdir $(shell ls $(AUDIO_ROOT)/include/uapi/audio/linux/*.h)), $(AUDIO_ROOT)/include/uapi/audio/linux/, $(UAPI_OUT)/linux/)
  70. $(call PROCESS_HEADERS, $(notdir $(shell ls $(AUDIO_ROOT)/include/uapi/audio/linux/mfd/wcd9xxx/*.h)), $(AUDIO_ROOT)/include/uapi/audio/linux/mfd/wcd9xxx/, $(UAPI_OUT)/linux/mfd/wcd9xxx/)
  71. $(call PROCESS_HEADERS, $(notdir $(shell ls $(AUDIO_ROOT)/include/uapi/audio/sound/*.h)), $(AUDIO_ROOT)/include/uapi/audio/sound/, $(UAPI_OUT)/sound/)
  72. $(shell mkdir $(KERNEL_BINARY_DIR)/usr/include/audio)
  73. $(shell mkdir $(KERNEL_BINARY_DIR)/usr/include/audio/sound)
  74. $(shell mkdir $(KERNEL_BINARY_DIR)/usr/include/audio/linux)
  75. $(shell mkdir $(KERNEL_BINARY_DIR)/usr/include/audio/linux/mfd)
  76. $(shell mkdir $(KERNEL_BINARY_DIR)/usr/include/audio/linux/mfd/wcd9xxx)
  77. $(call PROCESS_HEADERS, $(notdir $(shell ls $(AUDIO_ROOT)/include/uapi/audio/linux/*.h)), $(AUDIO_ROOT)/include/uapi/audio/linux/, $(KERNEL_BINARY_DIR)/usr/include/audio/linux/)
  78. $(call PROCESS_HEADERS, $(notdir $(shell ls $(AUDIO_ROOT)/include/uapi/audio/linux/mfd/wcd9xxx/*.h)), $(AUDIO_ROOT)/include/uapi/audio/linux/mfd/wcd9xxx/, $(KERNEL_BINARY_DIR)/usr/include/audio/linux/mfd/wcd9xxx/)
  79. $(call PROCESS_HEADERS, $(notdir $(shell ls $(AUDIO_ROOT)/include/uapi/audio/sound/*.h)), $(AUDIO_ROOT)/include/uapi/audio/sound/, $(KERNEL_BINARY_DIR)/usr/include/audio/sound/)
  80. $(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules $(KBUILD_OPTIONS)
  81. modules_install:
  82. $(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(shell pwd) modules_install
  83. clean:
  84. rm -f *.o *.ko *.mod.c *.mod.o *~ .*.cmd Module.symvers
  85. rm -rf .tmp_versions