I would like to build a standalone kernel module. But when I 'make', I get error.

My Makefile is:

obj-m  := hellomodule.o 
KERNEL_HEADER := /home/ubuntu/backfire/build_dir/linux-brcm-2.4/linux-2.4.37.9
CROSS_COMPILE := /home/ubuntu/backfire/staging_dir/toolchain-mipsel_gcc-3.4.6_uClibc-0.9.30.1/bin/mipsel-openwrt-linux-
all: 
    make ARCH=mips CROSS_COMPILE=$(CROSS_COMPILE) -C $(KERNEL_HEADER) SUBDIRS=$(PWD) modules
clean: 
    rm -rf *.o
    rm -rf *.ko
    rm -rf *.symvers
    rm -rf *.order
    rm -rf *.mod.c

The error is:

make ARCH=mips CROSS_COMPILE=/home/ubuntu/backfire/staging_dir/toolchain-mipsel_gcc-3.4.6_uClibc-0.9.30.1/bin/mipsel-openwrt-linux- -C /home/ubuntu/backfire/build_dir/linux-brcm-2.4/linux-2.4.37.9 SUBDIRS=/home/ubuntu/Desktop/hello modules
make[1]: Entering directory `/home/ubuntu/backfire/build_dir/linux-brcm-2.4/linux-2.4.37.9'
make -C  /home/ubuntu/Desktop/hello CFLAGS="-D__KERNEL__ -I/home/ubuntu/backfire/build_dir/linux-brcm-2.4/linux-2.4.37.9/include -Wall -Wstrict-prototypes -Wno-trigraphs -Os -fno-strict-aliasing -fno-common -fno-builtin-strpbrk -fno-builtin-sprintf -fomit-frame-pointer  -fno-delete-null-pointer-checks  -funit-at-a-time -I /home/ubuntu/backfire/build_dir/linux-brcm-2.4/linux-2.4.37.9/include/asm/gcc -G 0 -mno-abicalls -fno-pic -pipe  -finline-limit=100000 -mabi=32 -march=mips32 -Wa,-32 -Wa,-march=mips32 -Wa,-mips32 -Wa,--trap -DMODULE -mlong-calls -fno-common" MAKING_MODULES=1 modules
make[2]: Entering directory `/home/ubuntu/Desktop/hello'
make[2]: *** No rule to make target `modules'.  Stop.
make[2]: Leaving directory `/home/ubuntu/Desktop/hello'
make[1]: *** [_mod_/home/ubuntu/Desktop/hello] Error 2
make[1]: Leaving directory `/home/ubuntu/backfire/build_dir/linux-brcm-2.4/linux-2.4.37.9'
make: *** [all] Error 2

My router is WRT54GL v1.1

Thank you!.

(Last edited by duy.ipad on 6 Jan 2014, 11:01)