Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 10-07-2007, 11:35 PM   #1
LQ Newbie
Registered: Sep 2007
Posts: 5

Rep: Reputation: 0
Question regarding 2.6 kernel module makefiles

Hi all, I understand that for kernel 2.6 driver modules, the makefile is in the below format:

obj-m += hello.o

hello-objs:= hello1.o hello2.o
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

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

This is a very simple makefile for 2 files kernel 2.6 modules existing in a single directory. So what if there is more files involved in different directories? Is there any way that I can make different object files inside different directories but generated the objects into one consolidated directory (eg ../obj/)?

Old 10-09-2007, 12:04 PM   #2
HCL Maintainer
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
See here and here.


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
kernel module question for kernel build davimint Slackware 2 09-22-2006 08:03 PM
Kernel Module Loading question. rconan Debian 1 04-28-2006 02:16 PM
Question about makefiles evolutionspeak Linux - Newbie 2 11-18-2005 01:08 AM
kernel 2.6 module programming question??? new5244 Programming 3 01-31-2004 03:43 PM
Question about Makefiles xailer Linux - Newbie 5 11-24-2003 11:43 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:22 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration