Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-03-2004, 01:15 AM   #1
LQ Newbie
Registered: Nov 2003
Posts: 25

Rep: Reputation: 15
How to create a Kernel 2.6 Makefile

Hello there,

can somebody please tell me how to create a Makefile to build modules for Kernel 2.6.x or where to find informations about it? I know how to create a makefile which builds single kernel modules (.ko) from single object-files (.o). But what I need to know is how to create a makefile which links a single kernel module from several object-files (.o)

My current makefile:
obj-m := test1.o test2.o test3.o

KDIR := /var/ists/fs/kernel-$(shell uname -r)/linux-$(shell uname -r)/
PWD := $(shell pwd)

        $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
... results in this:

test1.c ---> test1.o ---> test1.ko
test2.c ---> test2.o ---> test2.ko
test3.c ---> test3.o ---> test3.ko
but how to do this:

test1.c --> test1.o \
test2.c --> test2.o ---> module.ko
test3.c --> test3.o /

Thanks a lot!

kind regards
Old 11-03-2004, 07:47 AM   #2
LQ Newbie
Registered: Nov 2003
Posts: 25

Original Poster
Rep: Reputation: 15
Yeah, got it!


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
configure doesn't create a Makefile (with anjuta) crashmakerMX Programming 5 06-24-2005 04:48 PM
create GNU make Makefile from visualstudio project andreyk Programming 0 02-02-2005 10:25 AM
How to write makefile to create shared library in 2.6 kernel yogeshwar_s Linux - Software 1 12-29-2004 12:39 AM
Create my own configure and Makefile Ephracis Linux - Software 1 10-11-2004 08:00 PM
Software Installation - How to Create MAKEFILE Luddite Linux - Newbie 3 11-21-2003 10:48 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:15 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