From 9461e4c40e95e42bd7e63c25a8f466c3633d9226 Mon Sep 17 00:00:00 2001 From: Mark Farrugia Date: Thu, 30 Aug 2018 18:18:34 +1000 Subject: Adds 'all' and 'clean' to Makefile for out-of-tree builds This will work for both AGL builds and non-AGL builds Signed-off-by: Mark Farrugia --- Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 88eebbd..0c02c23 100644 --- a/Makefile +++ b/Makefile @@ -14,3 +14,22 @@ 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 + -- cgit 1.2.3-korg