Sachin Mohan Gadag | 0ebe6b8 | 2018-03-12 12:07:41 +0530 | [diff] [blame] | 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 | |
| 6 | KBUILD_OPTIONS := AUDIO_ROOT=$(PWD) |
| 7 | KBUILD_OPTIONS += MODNAME=audio |
| 8 | KBUILD_OPTIONS += UAPI_OUT=$(PWD) |
| 9 | |
| 10 | AUDIO_KERNEL_HEADERS_PATH1 = $(shell ls ./include/uapi/linux/*.h) |
| 11 | AUDIO_KERNEL_HEADERS_PATH2 = $(shell ls ./include/uapi/linux/mfd/wcd9xxx/*.h) |
| 12 | AUDIO_KERNEL_HEADERS_PATH3 = $(shell ls ./include/uapi/sound/*.h) |
| 13 | |
Sachin Mohan Gadag | 0ebe6b8 | 2018-03-12 12:07:41 +0530 | [diff] [blame] | 14 | ifeq ($(TARGET_SUPPORT),qcs40x) |
| 15 | KBUILD_OPTIONS += CONFIG_ARCH_QCS405=y |
| 16 | endif |
Sachin Mohan Gadag | e8367cb | 2019-06-27 20:15:41 +0530 | [diff] [blame] | 17 | ifeq ($(TARGET_SUPPORT), sdmsteppe) |
Md Mansoor Ahmed | 2382aaa | 2018-11-20 11:06:32 +0530 | [diff] [blame] | 18 | KBUILD_OPTIONS += CONFIG_ARCH_SM6150=y |
| 19 | endif |
Sachin Mohan Gadag | 0ebe6b8 | 2018-03-12 12:07:41 +0530 | [diff] [blame] | 20 | |
| 21 | obj-m := ipc/ |
| 22 | obj-m += dsp/ |
| 23 | obj-m += dsp/codecs/ |
| 24 | obj-m += soc/ |
| 25 | obj-m += asoc/ |
| 26 | obj-m += asoc/codecs/ |
Meng Wang | d6107d0 | 2018-11-16 13:06:16 +0800 | [diff] [blame] | 27 | ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sdmsteppe)) |
Sachin Mohan Gadag | 0ebe6b8 | 2018-03-12 12:07:41 +0530 | [diff] [blame] | 28 | obj-m += asoc/codecs/wcd934x/ |
| 29 | endif |
Sachin Mohan Gadag | 0ebe6b8 | 2018-03-12 12:07:41 +0530 | [diff] [blame] | 30 | ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), qcs40x)) |
| 31 | obj-m += asoc/codecs/bolero/ |
Mangesh Kunchamwar | e81de8f | 2018-06-22 22:22:27 +0530 | [diff] [blame] | 32 | obj-m += asoc/codecs/csra66x0/ |
Ralf Herz | 5f30251 | 2018-06-21 18:50:09 +0200 | [diff] [blame] | 33 | obj-m += asoc/codecs/ep92/ |
Sachin Mohan Gadag | 0ebe6b8 | 2018-03-12 12:07:41 +0530 | [diff] [blame] | 34 | endif |
Sachin Mohan Gadag | e8367cb | 2019-06-27 20:15:41 +0530 | [diff] [blame] | 35 | ifeq ($(TARGET_SUPPORT), sdmsteppe) |
Md Mansoor Ahmed | 2382aaa | 2018-11-20 11:06:32 +0530 | [diff] [blame] | 36 | obj-m += asoc/codecs/bolero/ |
| 37 | obj-m += asoc/codecs/wcd937x/ |
| 38 | endif |
Sachin Mohan Gadag | 0ebe6b8 | 2018-03-12 12:07:41 +0530 | [diff] [blame] | 39 | |
Baochu Xu | 9b8ab6d | 2020-01-07 15:36:04 +0800 | [diff] [blame] | 40 | ifeq ($(TARGET_SUPPORT), qrb5165) |
| 41 | obj-m += asoc/codecs/bolero/ |
| 42 | obj-m += asoc/codecs/wcd938x/ |
| 43 | endif |
| 44 | |
Han Lu | a1670ee | 2019-07-25 10:13:20 +0800 | [diff] [blame] | 45 | ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sa8155 sa8155ivi sa6155 sa8195 qtiquingvm)) |
Cong Tang | fe8dee2 | 2019-01-10 18:36:55 +0800 | [diff] [blame] | 46 | obj-m := ipc/ |
| 47 | obj-m += dsp/ |
| 48 | obj-m += asoc/ |
| 49 | obj-m += asoc/codecs/ |
Cong Tang | 6938b83 | 2019-04-18 09:18:29 +0800 | [diff] [blame] | 50 | obj-m += soc/ |
Han Lu | a1670ee | 2019-07-25 10:13:20 +0800 | [diff] [blame] | 51 | ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sa8155 sa8155ivi sa8195 qtiquingvm)) |
Cong Tang | fe8dee2 | 2019-01-10 18:36:55 +0800 | [diff] [blame] | 52 | KBUILD_OPTIONS += CONFIG_SND_SOC_SA8155=m |
| 53 | endif |
Guodong Hu | a5b505a | 2019-07-03 17:22:06 +0800 | [diff] [blame] | 54 | ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sa6155)) |
| 55 | KBUILD_OPTIONS += CONFIG_SND_SOC_SA6155=m |
| 56 | endif |
Baochu Xu | 9b8ab6d | 2020-01-07 15:36:04 +0800 | [diff] [blame] | 57 | ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), qrb5165)) |
| 58 | KBUILD_OPTIONS += CONFIG_SND_SOC_KONA=m |
| 59 | endif |
Guodong Hu | a5b505a | 2019-07-03 17:22:06 +0800 | [diff] [blame] | 60 | endif |
Cong Tang | fe8dee2 | 2019-01-10 18:36:55 +0800 | [diff] [blame] | 61 | |
Sachin Mohan Gadag | 0ebe6b8 | 2018-03-12 12:07:41 +0530 | [diff] [blame] | 62 | all: |
| 63 | $(shell rm -fr $(shell pwd)/soc/core.h) |
| 64 | $(shell ln -s $(KERNEL_SRC)/drivers/pinctrl/core.h $(shell pwd)/soc/core.h) |
| 65 | $(shell rm -fr $(shell pwd)/include/soc/internal.h) |
| 66 | $(shell ln -s $(KERNEL_SRC)/drivers/base/regmap/internal.h $(shell pwd)/include/soc/internal.h) |
| 67 | $(shell rm -fr $(shell pwd)/soc/pinctrl-utils.h) |
| 68 | $(shell ln -s $(KERNEL_SRC)/drivers/pinctrl/pinctrl-utils.h $(shell pwd)/soc/pinctrl-utils.h) |
| 69 | $(shell mkdir $(shell pwd)/linux) |
| 70 | $(shell mkdir $(shell pwd)/sound) |
| 71 | $(shell mkdir $(shell pwd)/linux/mfd) |
| 72 | $(shell mkdir $(shell pwd)/linux/mfd/wcd9xxx) |
| 73 | $(shell cd $(KERNEL_BINARY_DIR) && $(KERNEL_SRC)/scripts/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ $(notdir $(AUDIO_KERNEL_HEADERS_PATH1))) |
| 74 | $(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))) |
| 75 | $(shell cd $(KERNEL_BINARY_DIR) && $(KERNEL_SRC)/scripts/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ $(notdir $(AUDIO_KERNEL_HEADERS_PATH3))) |
Guodong Hu | 1fc900d | 2019-06-28 15:47:05 +0800 | [diff] [blame] | 76 | $(shell mkdir $(KERNEL_BINARY_DIR)/usr/include/sound) |
| 77 | $(shell mkdir $(KERNEL_BINARY_DIR)/usr/include/linux/mfd) |
| 78 | $(shell mkdir $(KERNEL_BINARY_DIR)/usr/include/linux/mfd/wcd9xxx) |
| 79 | $(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))) |
| 80 | $(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))) |
| 81 | $(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))) |
Sachin Mohan Gadag | 0ebe6b8 | 2018-03-12 12:07:41 +0530 | [diff] [blame] | 82 | $(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules $(KBUILD_OPTIONS) |
| 83 | |
| 84 | modules_install: |
| 85 | $(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(shell pwd) modules_install |
| 86 | |
| 87 | clean: |
| 88 | rm -f *.o *.ko *.mod.c *.mod.o *~ .*.cmd Module.symvers |
| 89 | rm -rf .tmp_versions |