LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   make: Nothing to be done for `default'. (https://www.linuxquestions.org/questions/linux-newbie-8/make-nothing-to-be-done-for-%60default-818864/)

boidi 07-09-2010 04:12 AM

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'.

Aquarius_Girl 07-09-2010 04:16 AM

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.

grail 07-09-2010 04:19 AM

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.

boidi 07-09-2010 04:40 AM

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.....

Aquarius_Girl 07-09-2010 04:41 AM

Did you replace the moduleName.o with your file name ?
Kindly paste the **exact** Makefile code here:

boidi 07-09-2010 05:12 AM

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'.

Aquarius_Girl 07-09-2010 05:15 AM

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 ?

boidi 07-09-2010 05:18 AM

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

i am compiling in fc11..

Aquarius_Girl 07-09-2010 05:19 AM

and you have written the Makefile exactly same as in post number 7 ?

boidi 07-09-2010 05:20 AM

exactly
copied and pasted

boidi 07-09-2010 05:35 AM

please anyone help me

Aquarius_Girl 07-09-2010 05:36 AM

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


boidi 07-09-2010 05:42 AM

i thought of saying it is in red colour.......
Thanx a lot
this is my first device driver

Aquarius_Girl 07-09-2010 05:43 AM

You are welcome :)

So it has compiled finally ? Makefiles are TAB dependent !

boidi 07-09-2010 06:00 AM

Quote:

Originally Posted by anishakaul (Post 4028177)

thanx a lot
bye


All times are GMT -5. The time now is 11:28 AM.