blob: 7ee55c0d236c3aa837b564ba5e79430a8f10c588 [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
Md Mansoor Ahmed2382aaa2018-11-20 11:06:32 +053017ifeq ($(TARGET_SUPPORT), sdmsteppe))
18KBUILD_OPTIONS += CONFIG_ARCH_SM6150=y
19endif
Sachin Mohan Gadag0ebe6b82018-03-12 12:07:41 +053020
21obj-m := ipc/
22obj-m += dsp/
23obj-m += dsp/codecs/
24obj-m += soc/
25obj-m += asoc/
26obj-m += asoc/codecs/
Meng Wangd6107d02018-11-16 13:06:16 +080027ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sdmsteppe))
Sachin Mohan Gadag0ebe6b82018-03-12 12:07:41 +053028obj-m += asoc/codecs/wcd934x/
29endif
Sachin Mohan Gadag0ebe6b82018-03-12 12:07:41 +053030ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), qcs40x))
31obj-m += asoc/codecs/bolero/
Mangesh Kunchamware81de8f2018-06-22 22:22:27 +053032obj-m += asoc/codecs/csra66x0/
Ralf Herz5f302512018-06-21 18:50:09 +020033obj-m += asoc/codecs/ep92/
Sachin Mohan Gadag0ebe6b82018-03-12 12:07:41 +053034endif
Md Mansoor Ahmed2382aaa2018-11-20 11:06:32 +053035ifeq ($(TARGET_SUPPORT), sdmsteppe))
36obj-m += asoc/codecs/bolero/
37obj-m += asoc/codecs/wcd937x/
38endif
Sachin Mohan Gadag0ebe6b82018-03-12 12:07:41 +053039
40all:
41 $(shell rm -fr $(shell pwd)/soc/core.h)
42 $(shell ln -s $(KERNEL_SRC)/drivers/pinctrl/core.h $(shell pwd)/soc/core.h)
43 $(shell rm -fr $(shell pwd)/include/soc/internal.h)
44 $(shell ln -s $(KERNEL_SRC)/drivers/base/regmap/internal.h $(shell pwd)/include/soc/internal.h)
45 $(shell rm -fr $(shell pwd)/soc/pinctrl-utils.h)
46 $(shell ln -s $(KERNEL_SRC)/drivers/pinctrl/pinctrl-utils.h $(shell pwd)/soc/pinctrl-utils.h)
47 $(shell mkdir $(shell pwd)/linux)
48 $(shell mkdir $(shell pwd)/sound)
49 $(shell mkdir $(shell pwd)/linux/mfd)
50 $(shell mkdir $(shell pwd)/linux/mfd/wcd9xxx)
51 $(shell cd $(KERNEL_BINARY_DIR) && $(KERNEL_SRC)/scripts/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ $(notdir $(AUDIO_KERNEL_HEADERS_PATH1)))
52 $(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)))
53 $(shell cd $(KERNEL_BINARY_DIR) && $(KERNEL_SRC)/scripts/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ $(notdir $(AUDIO_KERNEL_HEADERS_PATH3)))
54 $(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules $(KBUILD_OPTIONS)
55
56modules_install:
57 $(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(shell pwd) modules_install
58
59clean:
60 rm -f *.o *.ko *.mod.c *.mod.o *~ .*.cmd Module.symvers
61 rm -rf .tmp_versions