Find the answer to your Linux question:
Results 1 to 5 of 5
Hello friends, I am a beginner in Linux. Never did any kernel programming in Linux/Windows before. I am now on a project and I am supposed to understand a Linux ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2009
    Posts
    15

    Question How to use a Makefile?


    Hello friends,

    I am a beginner in Linux. Never did any kernel programming in Linux/Windows before. I am now on a project and I am supposed to understand a Linux Device Driver Code. It contains 6 .c files and 1 Makefile. The make file goes as this:

    obj-m := X.o
    X-objs := a.o b.o c.o d.o e.o f.o


    I have a.c b.c c.c d.c d.c e.c f.c in the director along with the Makefile mentioned.

    I am using Fedora Red Hat Linux 32 bit.

    Please suggest me how to compile the Makefile.

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,233
    You don't compile a Makefile. It isn't code, it's just a set of instructions for the make command. Try typing make and see what happens.
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  3. #3
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Feb 2009
    Posts
    15
    Thanks guys!
    I compiled my driver successfuly. I have also installed zlib package since my driver depends on it.
    While I try to insert my module (insmod X.ko), I get an error saying "Error inserting "X.ko" : -1 Unknown symbol in module" . What am I supposed to do? I tried several ways showin in google. None of them improved my results.
    Can you guys pull me out?

  6. #5
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,233
    I think you use the module name without the .ko suffix. And it's better to use modprobe rather than insmod as it works more intelligently, pre-inserting any other modules on which yours depends.
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

Posting Permissions

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