LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   why make command is not working (https://www.linuxquestions.org/questions/linux-newbie-8/why-make-command-is-not-working-4175412113/)

tushar_pandey 06-18-2012 02:39 PM

why make command is not working
 
i am using make command for compiling my module , but it is working properly !

see i have created my module ... hello.c & i am taking the help of this article "http://www.cyberciti.biz/tips/compiling-linux-kernel-module.html"

so my whole procedure is based on this article !

knudfl 06-18-2012 03:08 PM

( http://www.cyberciti.biz/tips/compil...el-module.html
> http://www.tldp.org/LDP/lkmpg/2.6/html/hello2.html )

This Makefile will work : hello-1.o , hello-1.ko are created ..
Code:

obj-m    := hello-1.o

KDIR    := /lib/modules/$(shell uname -r)/build
PWD    := $(shell pwd)

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


.

tushar_pandey 06-19-2012 03:55 AM

to , knudfl , thanks for your reply
 
but can you please explain this process in detail , because i am new in LINUX and i want to join device driver development , so please if you can help me !

.... still i am not able to create modules !

pan64 06-19-2012 04:02 AM

I do not think this is the normal way of learning: you have just started to learn "linux" and you now want to implement device drivers without knowing how a simple makefile works. Aren't you?

knudfl 06-19-2012 04:30 AM

The way I see it :
A couple of lines are missing in the Makefile's from your link.


Prerequisites for building kernel modules :
A Linux OS that's easy to use for development.
Like Slackware, Fedora 17, CentOS 6.
I.e. the required kernel module build files in /usr/src/
are either included, or easy to install / update.

Which OS do you intend to use ?
.


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