All pastes #777023 Raw Edit

Sample Makefile and testmodule f

public text v1 · immutable
·published 2007-11-16 13:23 UTC
rendered paste body
Makefile:
ARCH := avr32
CROSS_COMPILE := /home/hcegtvedt/gitwork/buildroot/build_avr32_nofpu/staging_dir/bin/avr32-linux-
KDIR := /home/hcegtvedt/gitwork/buildroot/project_build_avr32_nofpu/atngw100/linux-2.6.23
PWD := $(shell pwd)

obj-m := testmodule.o

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

clean:
	rm -rf testmodule.ko testmodule.o* testmodule.mod* .testmodule* .tmp* Module*

testmodule.c
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/io.h>

int init_module(void)
{
	printk("hello\n");
	return 0;
}

void cleanup_module(void)
{
	printk("world\n");
}