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