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 #include #include int init_module(void) { printk("hello\n"); return 0; } void cleanup_module(void) { printk("world\n"); }