nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Need Help ....What is 'obj-m = hello.o'

This is a discussion on Need Help ....What is 'obj-m = hello.o' within the Getting started tutorials forums, part of the Linux Getting Started category; Hello friends I use the following lines many times in makefile - while building kernel module- ...... obj-m = hello.o ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Getting started tutorials

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 06-28-2007, 11:22 AM
Junior Member
User
 
Join Date: Jun 2007
My distro: Debian
Posts: 2
Rep Power: 0
amimargo is on a distinguished road
Default Need Help ....What is 'obj-m = hello.o'

Hello friends
I use the following lines many times in makefile - while building kernel module-
......
obj-m = hello.o
..........

where hello.o is my kernel module name.

Can anybody explain me why ' obj-m= ' is used ? I tried to find out in Linux Device Driver Book.But the book only says ' ...using gcc make extension... ' .
If anybody has any idea please explain .


Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-29-2007, 01:42 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 910
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

It means build driver called hello.ko (2.6.xx kernel) / hello.o (2.4.xx kernel).

obj = object
m = module or driver

Let me know if you need any further assistance
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #3 (permalink)  
Old 06-29-2007, 10:15 AM
Junior Member
User
 
Join Date: Jun 2007
My distro: Debian
Posts: 2
Rep Power: 0
amimargo is on a distinguished road
Default

Quote:
Originally Posted by nixcraft View Post
It means build driver called hello.ko (2.6.xx kernel) / hello.o (2.4.xx kernel).

obj = object
m = module or driver

Let me know if you need any further assistance

Still i could not understand.How the make interpret the rule.Could you say details?And what is the make gcc extention by which it is possible ?
Reply With Quote
  #4 (permalink)  
Old 07-05-2007, 09:54 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 557
Rep Power: 6
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Quote:
Originally Posted by amimargo View Post
Still i could not understand.How the make interpret the rule.Could you say details?And what is the make gcc extention by which it is possible ?
obj-m is a list of what kernel modules to build. The .o and other objects will be automatically built from the corresponding .c file (no need to list the source files explicitly).
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #5 (permalink)  
Old 03-25-2008, 12:58 AM
Member
User
 
Join Date: Mar 2008
My distro: Debian, Slackware, LFS
Posts: 83
Rep Power: 1
Tux-Idiot is on a distinguished road
Default

man elf
man core
tlkm guide
khg
oreilly linux kernel hackers handbook!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +5.5. The time now is 04:57 AM.


Powered by vBulletin® Version 3.7.2 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36