Makefile.am 3.6 KB

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