Makefile.am 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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), $(filter $(TARGET_SUPPORT), sdm670 qcs605))
  12. KBUILD_OPTIONS += CONFIG_ARCH_SDM670=y
  13. endif
  14. ifeq ($(TARGET_SUPPORT),sdm845)
  15. KBUILD_OPTIONS += CONFIG_ARCH_SDM845=y
  16. endif
  17. ifeq ($(TARGET_SUPPORT),apq8053)
  18. KBUILD_OPTIONS += CONFIG_ARCH_SDM450=y
  19. endif
  20. ifeq ($(TARGET_SUPPORT),qcs40x)
  21. KBUILD_OPTIONS += CONFIG_ARCH_QCS405=y
  22. endif
  23. obj-m := ipc/
  24. obj-m += dsp/
  25. obj-m += dsp/codecs/
  26. obj-m += soc/
  27. obj-m += asoc/
  28. obj-m += asoc/codecs/
  29. ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sdm670 qcs605))
  30. obj-m += asoc/codecs/wcd934x/
  31. endif
  32. ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), apq8053 sdm670 qcs605))
  33. obj-m += asoc/codecs/sdm660_cdc/
  34. endif
  35. ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sdm670 qcs605))
  36. obj-m += asoc/codecs/msm_sdw/
  37. endif
  38. ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), qcs40x))
  39. obj-m += asoc/codecs/bolero/
  40. obj-m += asoc/codecs/csra66x0/
  41. obj-m += asoc/codecs/ep92/
  42. endif
  43. all:
  44. $(shell rm -fr $(shell pwd)/soc/core.h)
  45. $(shell ln -s $(KERNEL_SRC)/drivers/pinctrl/core.h $(shell pwd)/soc/core.h)
  46. $(shell rm -fr $(shell pwd)/include/soc/internal.h)
  47. $(shell ln -s $(KERNEL_SRC)/drivers/base/regmap/internal.h $(shell pwd)/include/soc/internal.h)
  48. $(shell rm -fr $(shell pwd)/soc/pinctrl-utils.h)
  49. $(shell ln -s $(KERNEL_SRC)/drivers/pinctrl/pinctrl-utils.h $(shell pwd)/soc/pinctrl-utils.h)
  50. $(shell mkdir $(shell pwd)/linux)
  51. $(shell mkdir $(shell pwd)/sound)
  52. $(shell mkdir $(shell pwd)/linux/mfd)
  53. $(shell mkdir $(shell pwd)/linux/mfd/wcd9xxx)
  54. $(shell cd $(KERNEL_BINARY_DIR) && $(KERNEL_SRC)/scripts/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ $(notdir $(AUDIO_KERNEL_HEADERS_PATH1)))
  55. $(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)))
  56. $(shell cd $(KERNEL_BINARY_DIR) && $(KERNEL_SRC)/scripts/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ $(notdir $(AUDIO_KERNEL_HEADERS_PATH3)))
  57. $(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules $(KBUILD_OPTIONS)
  58. modules_install:
  59. $(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(shell pwd) modules_install
  60. clean:
  61. rm -f *.o *.ko *.mod.c *.mod.o *~ .*.cmd Module.symvers
  62. rm -rf .tmp_versions