LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-31-2011, 03:44 AM   #1
mswamy78
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Rep: Reputation: Disabled
make[1]: *** No rule to make target `modules'. Stop.


I get following error when I compile my module...

make[1]: Entering directory `/usr/src/linux'
make[1]: *** No rule to make target `modules'. Stop.
make[1]: Leaving directory `/usr/src/linux'
make: *** [default] Error 2

My Makefile

obj-m := uvcvideo.o
uvcvideo-objs := uvc_driver.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean


#uname -a
Linux lucid-desktop 2.6.35.3-744-g27fdf7b #1 PREEMPT Thu Jan 27 15:10:16 CST 2011 armv7l GNU/Linux

Also I found /lib/modules/'uname -r' is pointing to /usr/src/linux

But under /usr/src/linux, except include folder there is no other folder present...

Please suggest
 
Old 08-31-2011, 04:23 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
sudo apt-get install linux-image-`uname -r` linux-headers-`uname -r`

Or use Synaptic to find a package "linux-headers" with an exact match
of your current "linux-image".

"linux-headers" is the package, that provide /usr/src/linux/include/<headers>

If you also get a new linux-image : Reboot to use it.

.
 
Old 08-31-2011, 06:13 AM   #3
mswamy78
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
Thanks for the reply.


I tried to download it...it is giving me error. My network is fine as I am able to download other things.

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package linux-image-2.6.35.3-744-g27fdf7b

I noticed that there are files under /usr/src/linux/include/
lucid@lucid-desktop:/usr/src/linux/include$ ls
asm asm-generic drm linux mtd rdma scsi sound video xen

In my Makefile the following line actually points to /usr/src/linux which is actually a link
KDIR := /lib/modules/$(shell uname -r)/build

even i tried to modify like this...KDIR := /usr/src/linux
Still no luck.

Please suggest
 
Old 08-31-2011, 06:23 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
linux-image-2.6.35.3-744-g27fdf7b : Is not a kernel supplied by Ubuntu.


If you created "2.6.35.3-744-g27fdf7b" yourself, then the source package
"linux-2.6.35.3-744-g27fdf7b/" can be used for the module build.
 
Old 08-31-2011, 06:45 AM   #5
mswamy78
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
I am using the source package for the compilation now..I changed KDIR as following in Makefile

obj-m := uvcvideo.o
uvcvideo-objs := uvc_driver.o
KDIR := /usr/src/linux-2.6.35.3-744-g27fdf7b
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean

But I still get following error..Please let me know what to do?

make[1]: Entering directory `/usr/src/linux'
make[1]: *** No rule to make target `modules'. Stop.
make[1]: Leaving directory `/usr/src/linux'
make: *** [default] Error 2
 
Old 09-01-2011, 11:26 AM   #6
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
What is the name of your source file , if it is only one file you can just use
obj-m := "source_filename".o
 
Old 09-02-2011, 01:15 AM   #7
mswamy78
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
Thanks for the reply. It is not a single file, i have multiple files to compile.
 
Old 09-03-2011, 12:50 AM   #8
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
[Quote]
obj-m := uvcvideo.o
uvcvideo-objs := uvc_driver.o
[Quote]

But the above lines of code suggest you are trying to compile only uvc_driver.c, do you have a source file by the name uvc_driver.c ?
 
  


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
*** No rule to make target `modules'. Stop. Help heffo_j Linux - Hardware 7 06-05-2011 12:44 PM
make[1]: *** No rule to make target `modules'. Stop. tjyorkshire Linux - Hardware 26 03-19-2009 10:14 AM
Belkin Wirless G RTL8185L make[1]: *** No rule to make target `Makefile'. Stop. SilverRock Linux - Wireless Networking 2 02-11-2007 08:25 AM
linux-wlan-ng: No rule to make target `modules'. Stop. johnc2k Linux - Software 1 01-26-2007 06:19 PM
*** No rule to make target `modules'. Stop. kmack2001 Linux - Newbie 9 02-16-2004 02:02 PM


All times are GMT -5. The time now is 05:47 AM.

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