Makefile.am 2.4 KB

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