-
-
Save artynet/55df1b7f381585157911165c33abb6be to your computer and use it in GitHub Desktop.
Linux kernel module makefile
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
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