I am trying to compile the Linux kernel: http://tldp.org/LDP/lkmpg/2.6/html/lkmpg.html
I have a simple program hello world hello-1.cpp
#include <linux/module.h> #include <linux/kernel.h> int init_module(void) { return 0; } void cleanup_module(void) { }
But I'm trying to create it using a Makefile:
obj-m += hello-1.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
I get a couple of errors.
make -C /home/pacman/linux-2.6.34.11/2.6.35.6-45.fc14.i686/build M=/home/pacman/p1 modules make: *** /home/pacman/linux-2.6.34.11/2.6.35.6-45.fc14.i686/build: No such file or directory. Stop.
make: * [all] Error 2
Am I forgetting to define something?
source share