Makefile.am 4.0 KB

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