LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 07-09-2010, 04:12 AM   #1
boidi
Member
 
Registered: Jun 2010
Location: Bangalore
Posts: 48

Rep: Reputation: 15
make: Nothing to be done for `default'.


Hi,
I am newbie to linux device drivers, while i am trying simle hello.c code i have this problem.

hello.c:

#include<linux/init.h>
#include <linux/module.h>
#include<linux/kernel.h>

MODULE_LICENSE(" Dual BSD/GPL ");

static int __init init_hello(void)
{
printk("<1>Hello World\n");
return 0;
}
static void __exit exit_hello(void)
{
printk("<1>Goodbye,cruel world\n");
}

module_init(init_hello);
module_exit(exit_hello);


Makefile for hello.c is

obj-m := hello.o

KDIR := /lib/modules/$(2.6.29.4-167.fc11.i686.PAE)/build
PWD := $(/home/purush/New)

default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules


i did make in root only, but it saying

make: Nothing to be done for `default'.
 
Old 07-09-2010, 04:16 AM   #2
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,619
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
See if the Makefile in the following link helps you somehow:
http://www.linuxquestions.org/questi...2/#post3766424

and write your code in code tags to make it easier for others to read.
 
Old 07-09-2010, 04:19 AM   #3
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,432

Rep: Reputation: 1878Reputation: 1878Reputation: 1878Reputation: 1878Reputation: 1878Reputation: 1878Reputation: 1878Reputation: 1878Reputation: 1878Reputation: 1878Reputation: 1878
Personally I would have to say that is one of the most complicated "simple" hello programs I have seen, but each to their own I guess.
 
Old 07-09-2010, 04:40 AM   #4
boidi
Member
 
Registered: Jun 2010
Location: Bangalore
Posts: 48

Original Poster
Rep: Reputation: 15
Code:
obj-m += moduleName.o

all:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
i have used above code and it saying
make: Nothing to be done for `all'.

what i have to give in shell?
make is only enough? or something else.....
 
Old 07-09-2010, 04:41 AM   #5
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,619
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
Did you replace the moduleName.o with your file name ?
Kindly paste the **exact** Makefile code here:
 
Old 07-09-2010, 05:12 AM   #6
boidi
Member
 
Registered: Jun 2010
Location: Bangalore
Posts: 48

Original Poster
Rep: Reputation: 15
Code:
obj-m += hello.o

all:
        make -C /lib/modules/$(2.6.29.4-167.fc11.i686.PAE)/build M=$(PWD) modules

clean:
        make -C /lib/modules/$(2.6.29.4-167.fc11.i686.PAE)/build M=$(PWD) clean

after that i gave make

o/p is : make: Nothing to be done for `all'.
 
Old 07-09-2010, 05:15 AM   #7
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,619
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
I told you only to change the Module name, keep the remaining things same.:
Code:
obj-m += hello.o

all:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
Is your "hello.c" and the "Makefile" in the same directory ?
 
Old 07-09-2010, 05:18 AM   #8
boidi
Member
 
Registered: Jun 2010
Location: Bangalore
Posts: 48

Original Poster
Rep: Reputation: 15
yaa.both are in same directory
still i am getting same
make: Nothing to be done for `all'.

i am compiling in fc11..
 
Old 07-09-2010, 05:19 AM   #9
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,619
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
and you have written the Makefile exactly same as in post number 7 ?
 
Old 07-09-2010, 05:20 AM   #10
boidi
Member
 
Registered: Jun 2010
Location: Bangalore
Posts: 48

Original Poster
Rep: Reputation: 15
exactly
copied and pasted
 
Old 07-09-2010, 05:35 AM   #11
boidi
Member
 
Registered: Jun 2010
Location: Bangalore
Posts: 48

Original Poster
Rep: Reputation: 15
please anyone help me
 
Old 07-09-2010, 05:36 AM   #12
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,619
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
Hello,
I got it,


When you copy paste the Makefile from post 7, make sure you delete the spaces shown in RED below by Backspace key and then press TAB

Code:
obj-m += hello.o

all:
........make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
........make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
 
1 members found this post helpful.
Old 07-09-2010, 05:42 AM   #13
boidi
Member
 
Registered: Jun 2010
Location: Bangalore
Posts: 48

Original Poster
Rep: Reputation: 15
i thought of saying it is in red colour.......
Thanx a lot
this is my first device driver
 
Old 07-09-2010, 05:43 AM   #14
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,619
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
You are welcome

So it has compiled finally ? Makefiles are TAB dependent !
 
Old 07-09-2010, 06:00 AM   #15
boidi
Member
 
Registered: Jun 2010
Location: Bangalore
Posts: 48

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by anishakaul View Post
thanx a lot
bye
 
  


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
Make thunar default? jmite Linux - Newbie 1 05-27-2009 02:03 AM
How to make it a default application? jethind Linux - Newbie 8 11-17-2005 06:36 AM
make application default reaky Linux - Software 5 05-23-2004 11:33 PM
Make default Gnome mairul Linux - Newbie 1 03-02-2004 03:19 AM
How do I make gnome my default wm? DrD Linux - Newbie 10 02-07-2004 12:30 AM


All times are GMT -5. The time now is 04:57 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration