All pastes #11736 Raw Edit

Untitled

public text v1 · immutable
#11736 ·published 2005-05-14 15:52 UTC
rendered paste body
Note

An exploded source tree is not required to build kernel modules against the currently in-use kernel.

For example, to build the foo.ko module, create the following file (named Makefile) in the directory containing the foo.c file:


obj-m    := foo.o

KDIR    := /lib/modules/$(shell uname -r)/build
PWD    := $(shell pwd)

default:
    $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules