All pastes #804215 Raw Edit

Sample Makefile and testmodule f

public text v1 · immutable
#804215 ·published 2007-12-03 06:19 UTC
rendered paste body
Makefile:
ARCH := avr32
CROSS_COMPILE := /home/avr32/buildroot/build_avr32_nofpu/staging_dir/bin/avr32-linux-
KDIR := /home/avr32/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");
}