Makefile.am 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. endif
  42. all:
  43. $(shell rm -fr $(shell pwd)/soc/core.h)
  44. $(shell ln -s $(KERNEL_SRC)/drivers/pinctrl/core.h $(shell pwd)/soc/core.h)
  45. $(shell rm -fr $(shell pwd)/include/soc/internal.h)
  46. $(shell ln -s $(KERNEL_SRC)/drivers/base/regmap/internal.h $(shell pwd)/include/soc/internal.h)
  47. $(shell rm -fr $(shell pwd)/soc/pinctrl-utils.h)
  48. $(shell ln -s $(KERNEL_SRC)/drivers/pinctrl/pinctrl-utils.h $(shell pwd)/soc/pinctrl-utils.h)
  49. $(shell mkdir $(shell pwd)/linux)
  50. $(shell mkdir $(shell pwd)/sound)
  51. $(shell mkdir $(shell pwd)/linux/mfd)
  52. $(shell mkdir $(shell pwd)/linux/mfd/wcd9xxx)
  53. $(shell cd $(KERNEL_BINARY_DIR) && $(KERNEL_SRC)/scripts/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ $(notdir $(AUDIO_KERNEL_HEADERS_PATH1)))
  54. $(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)))
  55. $(shell cd $(KERNEL_BINARY_DIR) && $(KERNEL_SRC)/scripts/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ $(notdir $(AUDIO_KERNEL_HEADERS_PATH3)))
  56. $(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules $(KBUILD_OPTIONS)
  57. modules_install:
  58. $(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(shell pwd) modules_install
  59. clean:
  60. rm -f *.o *.ko *.mod.c *.mod.o *~ .*.cmd Module.symvers
  61. rm -rf .tmp_versions