aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 0c02c23e2f80e1d891010b06dbabf6262def338f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_AVIRT) += avirt_core.o
avirt_core-y := core.o
avirt_core-y += alsa.o
avirt_core-y += alsa-pcm.o

ifeq ($(CONFIG_AVIRT_BUILDLOCAL),)
	CCFLAGS_AVIRT := "drivers/staging/"
else
	CCFLAGS_AVIRT := "$(PWD)/../"
endif

ccflags-y += -I${CCFLAGS_AVIRT}

$(info $(KERNELRELEASE))
obj-$(CONFIG_AVIRT_DUMMYAP)	+= dummy/

###
# For out-of-tree building
###
ifdef PKG_CONFIG_SYSROOT_DIR
	# AGL SDK kernel src path
	KERNEL_SRC=$(PKG_CONFIG_SYSROOT_DIR)/usr/src/kernel
else
	# General Linux distro kernel src path
	KERNEL_SRC=/lib/modules/$(shell uname -r)/build
endif

all:
	CONFIG_AVIRT=m CONFIG_AVIRT_BUILDLOCAL=y CONFIG_AVIRT_DUMMYAP=m \
	make -C $(KERNEL_SRC) M=$(PWD)

clean:
	make -C $(KERNEL_SRC) M=$(PWD) clean