blob: 9fb3d45c7e1b4306196236f202859f1dc1ee28b3 [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
14ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sdm670 qcs605))
15KBUILD_OPTIONS += CONFIG_ARCH_SDM670=y
16endif
17ifeq ($(TARGET_SUPPORT),sdm845)
18KBUILD_OPTIONS += CONFIG_ARCH_SDM845=y
19endif
20ifeq ($(TARGET_SUPPORT),apq8053)
21KBUILD_OPTIONS += CONFIG_ARCH_SDM450=y
22endif
23ifeq ($(TARGET_SUPPORT),qcs40x)
24KBUILD_OPTIONS += CONFIG_ARCH_QCS405=y
25endif
26
27obj-m := ipc/
28obj-m += dsp/
29obj-m += dsp/codecs/
30obj-m += soc/
31obj-m += asoc/
32obj-m += asoc/codecs/
33ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sdm670 qcs605))
34obj-m += asoc/codecs/wcd934x/
35endif
36ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), apq8053 sdm670 qcs605))
37obj-m += asoc/codecs/sdm660_cdc/
38endif
39ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), sdm670 qcs605))
40obj-m += asoc/codecs/msm_sdw/
41endif
42ifeq ($(TARGET_SUPPORT), $(filter $(TARGET_SUPPORT), qcs40x))
43obj-m += asoc/codecs/bolero/
44endif
45
46all:
47 $(shell rm -fr $(shell pwd)/soc/core.h)
48 $(shell ln -s $(KERNEL_SRC)/drivers/pinctrl/core.h $(shell pwd)/soc/core.h)
49 $(shell rm -fr $(shell pwd)/include/soc/internal.h)
50 $(shell ln -s $(KERNEL_SRC)/drivers/base/regmap/internal.h $(shell pwd)/include/soc/internal.h)
51 $(shell rm -fr $(shell pwd)/soc/pinctrl-utils.h)
52 $(shell ln -s $(KERNEL_SRC)/drivers/pinctrl/pinctrl-utils.h $(shell pwd)/soc/pinctrl-utils.h)
53 $(shell mkdir $(shell pwd)/linux)
54 $(shell mkdir $(shell pwd)/sound)
55 $(shell mkdir $(shell pwd)/linux/mfd)
56 $(shell mkdir $(shell pwd)/linux/mfd/wcd9xxx)
57 $(shell cd $(KERNEL_BINARY_DIR) && $(KERNEL_SRC)/scripts/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ $(notdir $(AUDIO_KERNEL_HEADERS_PATH1)))
58 $(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)))
59 $(shell cd $(KERNEL_BINARY_DIR) && $(KERNEL_SRC)/scripts/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ $(notdir $(AUDIO_KERNEL_HEADERS_PATH3)))
60 $(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules $(KBUILD_OPTIONS)
61
62modules_install:
63 $(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(shell pwd) modules_install
64
65clean:
66 rm -f *.o *.ko *.mod.c *.mod.o *~ .*.cmd Module.symvers
67 rm -rf .tmp_versions