[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] Compile loadable kernel modules



This is the simple makefile i used to test modules on the microblaze
sometime back. It worked fine.

===============
CC = /home/mblaze/linux/kernel/uClinux-dist/tools/ucfront/ucfront mb-gcc

CC_OPTION = -Os -g -fomit-frame-pointer -fno-common -fno-builtin -Wall
-mno-xl-soft-mul -mxl-soft-div

LINK_OPTION = -Wl,-elf2flt

all:    test

test.o: test.c
        ${CC} ${CC_OPTION} -c -o test.o test.c

test:   test.o test.c
        ${CC} ${LINK_OPTION} -o test test.o

clean:
        rm -rf test.o test
=======================================================

I included the following header files in the test.c
#include "stdio.h"
#include "unistd.h"
#include "stdlib.h" #include "sys/syscall.h"
#include "fcntl.h"

It worked fine. Hope it helps u.

- Prasad

On 1/22/06, Oscar Sánchez <dav18284@xxxxxxxxx> wrote:
>
>
> Hi,
> I'm trying to compile a loadable module for a char device. Here is my
> Makefile:
> TARGET := char_dev_ex
>
> WARN := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
>
>
>
>
> INCLUDE := -isystem
> /home/oscar/uClinux_src/uClinux_tmp/uClinux/uClinux-dist/linux-2.4.x/include
>
>
>
>
> CFLAGS := -O2 -DMODULE -D__KERNEL__ ${WARN} ${INCLUDE}
>
> CC := mb-gcc
>
>
>
> ${TARGET}.o: ${TARGET}.c
>
>
>
>
> .PHONY: clean
>
>
>
>
> clean:
>
>  rm -rf ${TARGET}.o
>
>  With this Makefile I have successful build some simple modules that only
> include linux/kernel.h and linux/module.h. But when I need to include
> linux/fs.h and asm/uaccess.h the compilation process shows a lot of warnings
> and don't finish correctly.
>
> What should I add to the Makefile??Thanks...
>
> Oscar.

___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/