Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    How to compile module?

    Hi every one
    Can anyone please help me in Compiling a Kernel module for 2.6
    any where iam not able to get a clear idea of the compilation n about writing Makefile .
    Please help me out

  2. #2
    here is the sample Makefile:
    obj-m += test.o # test.c is the source of your module.
    KDIR := /lib/modules/$(shell uname -r)/build
    PWD := $(shell pwd)
    $(MAKE) -C $(KDIR) M=$(PWD) modules
    if your module has multiple source files test1.c and test2.c and you need 1 module test
    then you will have:
    obj-m = test.o
    test-objs = test1.o test2.o
    Nice place to start:

  3. #3
    obj-m += test.o
    test-objs += test1.o test2.o

    (My bad)

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts