blob: 3a0e7f678f0a63fadf7fc856059f121757cfc67e [file] [log] [blame]
Sachin Mohan Gadag0ebe6b82018-03-12 12:07:41 +05301AUDIO_ROOT=$(PWD)
2UAPI_OUT=$(PWD)
3HEADER_INSTALL_DIR=$(KERNEL_SRC)/scripts
4KERNEL_BINARY_DIR=$(KERNEL_SRC)/../kernel-build-artifacts
5
6KBUILD_OPTIONS := AUDIO_ROOT=$(PWD)
7KBUILD_OPTIONS += MODNAME=audio
8KBUILD_OPTIONS += UAPI_OUT=$(PWD)
9
10AUDIO_KERNEL_HEADERS_PATH1 = $(shell ls ./include/uapi/linux/*.h)
11AUDIO_KERNEL_HEADERS_PATH2 = $(shell ls ./include/uapi/linux/mfd/wcd9xxx/*.h)
12AUDIO_KERNEL_HEADERS_PATH3 = $(shell ls ./include/uapi/sound/*.h)
13
Sachin Mohan Gadag0ebe6b82018-03-12 12:07:41 +053014ifeq ($(TARGET_SUPPORT),qcs40x)
15KBUILD_OPTIONS += CONFIG_ARCH_QCS405=y
16endif
Sachin Mohan Gadage8367cb2019-06-27 20:15:41 +053017ifeq ($(TARGET_SUPPORT), sdmsteppe)
Md Mansoor Ahmed2382aaa2018-11-20 11:06:32 +053018KBUILD_OPTIONS += CONFIG_ARCH_SM6150=y
19endif
Soumya Managolia620a952020-06-11 12:14:46 +053020ifeq ($(TARGET_SUPPORT),sdm660)
21KBUILD_OPTIONS += CONFIG_ARCH_SDM660=y
22endif
Sachin Mohan Gadag0ebe6b82018-03-12 12:07:41 +053023
24obj-m := ipc/
25obj-m += dsp/
26obj-m += dsp/codecs/
27obj-m += soc/
28obj-m += asoc/
29obj-m += asoc/codecs/
Meng Wangd6107d02018-11-16 13:06:16 +080030ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sdmsteppe))
Sachin Mohan Gadag0ebe6b82018-03-12 12:07:41 +053031obj-m += asoc/codecs/wcd934x/
32endif
Sachin Mohan Gadag0ebe6b82018-03-12 12:07:41 +053033ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), qcs40x))
34obj-m += asoc/codecs/bolero/
Mangesh Kunchamware81de8f2018-06-22 22:22:27 +053035obj-m += asoc/codecs/csra66x0/
Ralf Herz5f302512018-06-21 18:50:09 +020036obj-m += asoc/codecs/ep92/
Sachin Mohan Gadag0ebe6b82018-03-12 12:07:41 +053037endif
Sachin Mohan Gadage8367cb2019-06-27 20:15:41 +053038ifeq ($(TARGET_SUPPORT), sdmsteppe)
Md Mansoor Ahmed2382aaa2018-11-20 11:06:32 +053039obj-m += asoc/codecs/bolero/
40obj-m += asoc/codecs/wcd937x/
41endif
Sachin Mohan Gadag0ebe6b82018-03-12 12:07:41 +053042
Baochu Xu9b8ab6d2020-01-07 15:36:04 +080043ifeq ($(TARGET_SUPPORT), qrb5165)
44obj-m += asoc/codecs/bolero/
45obj-m += asoc/codecs/wcd938x/
46endif
47
Han Lua1670ee2019-07-25 10:13:20 +080048ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sa8155 sa8155ivi sa6155 sa8195 qtiquingvm))
Cong Tangfe8dee22019-01-10 18:36:55 +080049obj-m := ipc/
50obj-m += dsp/
51obj-m += asoc/
52obj-m += asoc/codecs/
Cong Tang6938b832019-04-18 09:18:29 +080053obj-m += soc/
Han Lua1670ee2019-07-25 10:13:20 +080054ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sa8155 sa8155ivi sa8195 qtiquingvm))
Cong Tangfe8dee22019-01-10 18:36:55 +080055KBUILD_OPTIONS += CONFIG_SND_SOC_SA8155=m
56endif
Guodong Hua5b505a2019-07-03 17:22:06 +080057ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sa6155))
58KBUILD_OPTIONS += CONFIG_SND_SOC_SA6155=m
59endif
Baochu Xu9b8ab6d2020-01-07 15:36:04 +080060ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), qrb5165))
61KBUILD_OPTIONS += CONFIG_SND_SOC_KONA=m
62endif
Guodong Hua5b505a2019-07-03 17:22:06 +080063endif
Cong Tangfe8dee22019-01-10 18:36:55 +080064
Sachin Mohan Gadag0ebe6b82018-03-12 12:07:41 +053065all:
66 $(shell rm -fr $(shell pwd)/soc/core.h)
67 $(shell ln -s $(KERNEL_SRC)/drivers/pinctrl/core.h $(shell pwd)/soc/core.h)
68 $(shell rm -fr $(shell pwd)/include/soc/internal.h)
69 $(shell ln -s $(KERNEL_SRC)/drivers/base/regmap/internal.h $(shell pwd)/include/soc/internal.h)
70 $(shell rm -fr $(shell pwd)/soc/pinctrl-utils.h)
71 $(shell ln -s $(KERNEL_SRC)/drivers/pinctrl/pinctrl-utils.h $(shell pwd)/soc/pinctrl-utils.h)
72 $(shell mkdir $(shell pwd)/linux)
73 $(shell mkdir $(shell pwd)/sound)
74 $(shell mkdir $(shell pwd)/linux/mfd)
75 $(shell mkdir $(shell pwd)/linux/mfd/wcd9xxx)
76 $(shell cd $(KERNEL_BINARY_DIR) && $(KERNEL_SRC)/scripts/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ $(notdir $(AUDIO_KERNEL_HEADERS_PATH1)))
77 $(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)))
78 $(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 Hu1fc900d2019-06-28 15:47:05 +080079 $(shell mkdir $(KERNEL_BINARY_DIR)/usr/include/sound)
80 $(shell mkdir $(KERNEL_BINARY_DIR)/usr/include/linux/mfd)
81 $(shell mkdir $(KERNEL_BINARY_DIR)/usr/include/linux/mfd/wcd9xxx)
82 $(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)))
83 $(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)))
84 $(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 Gadag0ebe6b82018-03-12 12:07:41 +053085 $(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules $(KBUILD_OPTIONS)
86
87modules_install:
88 $(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(shell pwd) modules_install
89
90clean:
91 rm -f *.o *.ko *.mod.c *.mod.o *~ .*.cmd Module.symvers
92 rm -rf .tmp_versions