LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-05-2009, 01:35 PM   #1
libinpk
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Rep: Reputation: 0
Unhappy Problem with make file


hi..i have been using the following make file to get .ko files in red hat linux. which i later used to insmod..

obj-m := mydriver.o

KERNDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

default:
$(MAKE) -C $(KERNDIR) M=`pwd` modules

clean:
rm -f *.ko *.mod.c *.o

but i installed ubuntu 6.06 recently and my make is no longer sucessful since ubuntu doesnt have /lib/modules/$(shell uname -r)/build path..

what do i do?any help is much appreciated.

PS: This is my first post..
 
Old 11-05-2009, 02:41 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,960

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by libinpk View Post
hi..i have been using the following make file to get .ko files in red hat linux. which i later used to insmod..

obj-m := mydriver.o

KERNDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

default:
$(MAKE) -C $(KERNDIR) M=`pwd` modules

clean:
rm -f *.ko *.mod.c *.o

but i installed ubuntu 6.06 recently and my make is no longer sucessful since ubuntu doesnt have /lib/modules/$(shell uname -r)/build path..

what do i do?any help is much appreciated.

PS: This is my first post..
Well, first off, Ubuntu 6.06 is VERY old, so if you recently installed it, I'd suggest installing the current version. After that, you don't say what version of RedHat you're coming from, but if you don't have the /lib/modules path, you probably don't have the kernel source installed. You could TRY to install it for 6.06, but I'd suggest loading the current version, and choosing it at build time for installation.
 
Old 11-05-2009, 02:58 PM   #3
imagine_me2
Member
 
Registered: Nov 2009
Location: Kolkata, India
Distribution: Fedora 11
Posts: 136

Rep: Reputation: 22
check if you have /lib/modules/[kernel name]/build by browsing your filesystem.
Sometimes it is linked to /usr/src/kernels/[kernel name], so check for that too.

[kernel name] can be found by typing
$uname -r

its actually your kernel source tree.

If you cant find the source tree in default location, it may not have come with your distro. So first install the kernel source tree, then to can use its path in the Make file.

If you have a little bit of time (and resource) you may choose to compile a whole new kernel and use it.
Then you will have the source tree for sure.
 
Old 11-06-2009, 10:57 AM   #4
libinpk
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Original Poster
Rep: Reputation: 0
thanks for your reply.. but it didnt solve my problem. i found that my /usr/src directory is empty. so what do i do? install it..?okay,but how do i do it?
 
Old 11-06-2009, 12:49 PM   #5
imagine_me2
Member
 
Registered: Nov 2009
Location: Kolkata, India
Distribution: Fedora 11
Posts: 136

Rep: Reputation: 22
I guess can you can get the kernel source tree from the distribution's official website. It will also contain the details how to install it.

Regarding installation of a new kernel its a time taking process which may not always be successful.
Let me know then , after you have considered the first option.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
the problem with rtl.h and the make file navderm Programming 2 12-22-2008 07:30 AM
Help needed for make file problem : make: *** No rule to make target `flash', needed rameshsatyavaram Linux - Newbie 3 09-11-2008 03:13 AM
Make Trouble linking some fortran code Make file problem? any ideas? TheBrick Linux - General 0 05-17-2006 12:21 PM
make file problem kranti Linux - Software 1 03-21-2006 08:36 AM
Hard Disk Partition&Make File System Problem jooj Linux - Hardware 3 02-23-2004 05:27 PM


All times are GMT -5. The time now is 05:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration