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