I am trying to compile a sample hello world module, but when issue make command, it says that "make: Nothing to be done for `all'.". Also I tried the command "make hello", then it is showing that "linux/module.h no such file". But I am in the newly compiled kernel. What might be the problem? -- thanks, kumaran
Hi, On Sun, Jul 10, 2011 at 10:07 AM, Ponkumaran Annadurai <aspkumaran@gmail.com> wrote:
I am trying to compile a sample hello world module, but when issue make command, it says that "make: Nothing to be done for `all'.". Also I tried
This is the sample Makefile that I use : You need to replace the first line with the corresponding name of your module file. My module file is testmod.c Also just type "make" and that should do the job. ------------------- Makefile -------------------------- obj-m += testmod.o KERNELDIR ?= /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) default: $(MAKE) -C $(KERNELDIR) M=$(PWD) clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions depend .depend dep: $(CC) $(CFLAGS) -M *.c > .depend ifeq (.depend,$(wildcard .depend)) include .depend endif ------------------------------------------------------------------
On Sun, Jul 10, 2011 at 11:03 AM, Prashant Shah <pshah.mumbai@gmail.com>wrote:
Hi,
On Sun, Jul 10, 2011 at 10:07 AM, Ponkumaran Annadurai <aspkumaran@gmail.com> wrote:
I am trying to compile a sample hello world module, but when issue make command, it says that "make: Nothing to be done for `all'.".
------------------- Makefile -------------------------- obj-m += testmod.o
KERNELDIR ?= /lib/modules/$(shell uname -r)/build PWD := $(shell pwd)
default: $(MAKE) -C $(KERNELDIR) M=$(PWD)
clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
depend .depend dep: $(CC) $(CFLAGS) -M *.c > .depend
ifeq (.depend,$(wildcard .depend)) include .depend endif
------------------------------------------------------------------
when I tried your script it prompted that there might be tab instead of eight spaces. So I inserted 8 spaces there, but it still prompted the same. Also I couldn't understand the script (particularly $(MAKE) - what does the variable stands for? also the rest of the code after "depend.depend.dep"). If you can explain the script, I shall know how to edit the script for my file. -- kumaran
Hi, On Sun, Jul 10, 2011 at 11:36 AM, Ponkumaran Annadurai <aspkumaran@gmail.com> wrote:
when I tried your script it prompted that there might be tab instead of eight spaces. So I inserted 8 spaces there, but it still prompted the same.
Email is messing up with spaces/tabs. Remove all spaces/etc and just put one tab.
Hi, On Sun, Jul 10, 2011 at 11:36 AM, Ponkumaran Annadurai <aspkumaran@gmail.com> wrote:
Also I couldn't understand the script (particularly $(MAKE) - what does the variable stands for? also the rest of the code after "depend.depend.dep"). If you can explain the script, I shall know how to edit the script for my file.
Edit the Makefile and add the following echo's default: echo $(MAKE) echo $(KERNELDIR) echo $(PWD) $(MAKE) -C $(KERNELDIR) M=$(PWD) You can try echoing the values of the variables. The $(MAKE) is the make command used.
On Sun, Jul 10, 2011 at 12:15 PM, Prashant Shah <pshah.mumbai@gmail.com>wrote:
Hi,
On Sun, Jul 10, 2011 at 11:36 AM, Ponkumaran Annadurai <aspkumaran@gmail.com> wrote:
Also I couldn't understand the script (particularly $(MAKE) - what does
the
variable stands for? also the rest of the code after "depend.depend.dep"). If you can explain the script, I shall know how to edit the script for my file.
Edit the Makefile and add the following echo's
`default: echo $(MAKE) echo $(KERNELDIR) echo $(PWD) $(MAKE) -C $(KERNELDIR) M=$(PWD)
You can try echoing the values of the variables. The $(MAKE) is the make command used.
Thanks sir, It worked. But still I couldn't understand what is the wrong in the makefile given in TLDP.org, also the if statements as said in the previous mail. One more thing can I install the new kernel in a virtual machine like virtual box? if so how can I do it? coz I can't access Internet from that kernel. Suggesting some measures will be helpful. -- thanks, kumaran
Dear Kumaran, Try to compile with the below makefile *" obj-m += hello-1.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" * Regards Sharief On Sun, Jul 10, 2011 at 12:24 PM, Ponkumaran Annadurai <aspkumaran@gmail.com
wrote:
On Sun, Jul 10, 2011 at 12:15 PM, Prashant Shah <pshah.mumbai@gmail.com>wrote:
Hi,
On Sun, Jul 10, 2011 at 11:36 AM, Ponkumaran Annadurai <aspkumaran@gmail.com> wrote:
Also I couldn't understand the script (particularly $(MAKE) - what does
the
variable stands for? also the rest of the code after "depend.depend.dep"). If you can explain the script, I shall know how to edit the script for my file.
Edit the Makefile and add the following echo's
`default: echo $(MAKE) echo $(KERNELDIR) echo $(PWD) $(MAKE) -C $(KERNELDIR) M=$(PWD)
You can try echoing the values of the variables. The $(MAKE) is the make command used.
Thanks sir, It worked. But still I couldn't understand what is the wrong in the makefile given in TLDP.org, also the if statements as said in the previous mail. One more thing can I install the new kernel in a virtual machine like virtual box? if so how can I do it? coz I can't access Internet from that kernel. Suggesting some measures will be helpful.
-- thanks, kumaran
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
On Sun, Jul 10, 2011 at 10:09 PM, Niamathullah sharief <newbiesha@gmail.com>wrote:
Dear Kumaran,
Try to compile with the below makefile
*"
obj-m += hello-1.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"
*This was the one I tried first, but it didn't work. The code suggested by Prashant worked. I just want to know why the above code doesn't work.
Regards Sharief
Thanks sir, It worked. But still I couldn't understand what is the wrong in the makefile given in TLDP.org, also the if statements as said in the previous mail. One more thing can I install the new kernel in a virtual machine like virtual box? if so how can I do it? coz I can't access Internet from that kernel. Suggesting some measures will be helpful.
-- thanks, kumaran
_______________________________________________
Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- thanks, kumaran
participants (3)
-
Niamathullah sharief -
Ponkumaran Annadurai -
Prashant Shah