Created
August 27, 2016 15:22
-
-
Save garyachy/1dc7fcb52bde291cece426f4e49b52de to your computer and use it in GitHub Desktop.
Linux kernel module makefile
This file contains 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
ifeq ($(KERNELRELEASE),) | |
KERNELDIR ?= /lib/modules/$(shell uname -r)/build | |
PWD := $(shell pwd) | |
modules: | |
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules EXTRA_CFLAGS="-g -DDEBUG" | |
modules_install: | |
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install | |
clean: | |
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions | |
.PHONY: modules modules_install clean | |
else | |
# called from kernel build system: just declare what our modules are | |
obj-m := netdev.o | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment