Download your favorite Linux distribution at LQ ISO.
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 03-08-2007, 12:11 AM   #1
Registered: Sep 2004
Location: Hyderabad.
Posts: 83

Rep: Reputation: 15
Question Building a single .ko file from multiple source files

Hi all,
I am writing a kernel level module. And my module source files are in two different directories. But i want to generate a single .ko file from these source files. I have a make file which will generate a single .ko file from multiple source files provided all the source files are in a single directory. But i dont how to change this to generate a single .ko file if source files are in two directories.
Dir1 is having file1.c,file2.c files
Dir2 is having file3.c file.
And Dir2 is inside the Dir1.
I want to compile all these files in to a single .ko file. Can any body know how to do this ? Thanks in advacne.

Old 04-01-2007, 10:34 AM   #2
LQ Guru
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
I don't know at all for sure, but do the two files reference each other/work together?
Could you not merge them into one source-code, thus becoming one file, and then compile it?

--Just guessing.
Old 04-01-2007, 01:51 PM   #3
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,874

Rep: Reputation: 554Reputation: 554Reputation: 554Reputation: 554Reputation: 554Reputation: 554
Just use relative paths in the Makefile to include the object files.


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
Delete a single E-mail / multiple mbox files mgichoga Debian 0 02-18-2007 09:42 PM
Adding Multiple Files In A Single Gz File onacorpuscle Linux - Newbie 3 08-31-2006 04:18 AM
How To Merge multiple files into a single PDF ? kkempter Linux - Software 1 10-28-2005 02:02 PM
Building kernel module from multiple source file in 2.6 kernel yogeshwar_s Programming 1 12-20-2004 10:31 AM
How do I decompress and desarchive multiple .tar.gz files to a single directory? Baldorg Linux - Software 7 11-27-2003 01:42 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:03 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration