LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 06-09-2008, 12:20 AM   #1
kapilaryan2003
LQ Newbie
 
Registered: Jul 2007
Posts: 4

Rep: Reputation: 0
problem in linux kernel module copilation using makefile(hello-1.c program) of lkmpg


hello friends,
presently i m using fedora core 8,i wants to start linux kernel module programming .when i started to compile my first program hello-1.c of linux kernel module programming guide,i got some problem in running makefile.like make:*** no target for '-C'..so please help me to resolve this problem.

your friend
kapil
 
Old 06-09-2008, 12:28 AM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 555Reputation: 555Reputation: 555Reputation: 555Reputation: 555Reputation: 555
please post the exact Make command you used (or more precisely, post us the Makefile). Looks like the syntax is wrong.
 
Old 06-09-2008, 05:04 AM   #3
kapilaryan2003
LQ Newbie
 
Registered: Jul 2007
Posts: 4

Original Poster
Rep: Reputation: 0
hello

Quote:
Originally Posted by GrapefruiTgirl View Post
please post the exact Make command you used (or more precisely, post us the Makefile). Looks like the syntax is wrong.
ok i m sending u the exact things:

i have made directory in home folder.then write a program in hello-1.c file as


/*
* hello-1.c - The simplest kernel module.
*/
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_INFO */

int init_module(void)
{
printk(KERN_INFO "Hello world 1.\n");

/*
* A non 0 return means init_module failed; module can't be loaded.
*/
return 0;
}

void cleanup_module(void)
{
printk(KERN_INFO "Goodbye world 1.\n");
}


then i have made a make file:

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


then i provide command:make
output is:
make -c /lib/modules/2.6.23.1.42-fc8/build M=/home/kapilaryan/Hello modules
make[1]:entry directory '/home/kapilaryan/Hello'
make[1]:***No rule to make target '-C'.stop.
make[1]:Leaving directory '/home/kapilaryan/Hello'
make:*** [all] Error2

please give me appropriate solution to resolve this problem.
 
  


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
how to edit makefile for kernel module? bhuvanmital Programming 5 02-02-2006 05:06 AM
need help in writing Makefile for module in 2.6 kernel videsh Programming 1 01-19-2006 07:35 AM
module makefile for c++ in kernel 2.6 yuhuahe Linux - Software 0 04-14-2004 06:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 09:32 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
Open Source Consulting | Domain Registration