summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-08-30 18:18:34 +1000
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-10-26 17:27:26 +1100
commit9461e4c40e95e42bd7e63c25a8f466c3633d9226 (patch)
tree9d54ed6fc3b2d3c1bef3bcb06af9bba3d21073e4
parente0fe74f581d6eb6717d7a44514fe4bffe7b5b4bb (diff)
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 <mark.farrugia@fiberdyne.com.au>
-rw-r--r--Makefile19
1 files changed, 19 insertions, 0 deletions
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
+