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