Created
July 27, 2016 04:53
-
-
Save clarkli86/1600f581cc0d70279ff0aa9fffcb79ea to your computer and use it in GitHub Desktop.
Build ko outside kernel source tree
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run me as | |
# ARCH=arm CROSS_COMPILE=~/buildroot-2016.05/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi- make | |
# If KERNELRELEASE is defined, we've been invoked from the | |
# kernel build system and can use its language. | |
ifneq ($(KERNELRELEASE),) | |
obj-m := kobject.o | |
# Otherwise we were called directly from the command | |
# line; invoke the kernel build system. | |
else | |
KERNELDIR ?= ../../output/build/linux-4.5.3/ | |
PWD := $(shell pwd) | |
default: | |
»·······$(MAKE) -C $(KERNELDIR) M=$(PWD) modules | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment