LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 11-03-2004, 01:15 AM   #1
7.e.Q
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:
Code:
obj-m := test1.o test2.o test3.o

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

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

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

Code:
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
7.e.Q
LQ Newbie
 
Registered: Nov 2003
Posts: 25

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


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
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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:15 AM.

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