All pastes #17975 Raw Edit

Untitled

public text v1 · immutable
#17975 ·published 2005-07-18 13:51 UTC
rendered paste body
You can then proceed as usual.
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

              

Issue the make command to build the foo.ko module.