LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-25-2014, 03:44 AM   #1
poplinux
Member
 
Registered: May 2012
Posts: 111

Rep: Reputation: Disabled
How to create multi source to one kernel module?


Dear Sir.

I have a two source.

common.c : base source. this source refer part1's api
part1.c : have some fun. this source refer common.c

common.c and part1.c have a cross reference.

common.c
Code:
int
base_api(void)
{
   int ret = part_api();
} 

int
print_all(void)
{
  printk(......);
}
part1.c
Code:
int
part_api(void)
{
   ........
   ........
}

int
test_api(void)
{
  print_all();
}

Makefile
Code:
obj-$(CONFIG_TEST) += common.o
common-objs := part1.c


But can't create one module file. created two module. common.ko and part1.ko


How to create one module file?
 
Old 08-25-2014, 03:46 AM   #2
poplinux
Member
 
Registered: May 2012
Posts: 111

Original Poster
Rep: Reputation: Disabled
Sorry. I'm found solution by myself

Makefile
Code:
obj-$(CONFIG_TEST) += test.o
test-objs := common.o part1.c
 
  


Reply



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
[SOLVED] Create kernel module with self build kernel schirrmie Linux - General 1 08-29-2011 08:25 AM
change the module and create custom kernel cccc Debian 9 05-30-2011 10:46 AM
How to create new process from within loadable kernel module? mtb001 Programming 5 08-31-2007 11:09 PM
LXer: Howto: build Linux kernel module against installed kernel w/o full kernel source tree LXer Syndicated Linux News 0 09-03-2006 08:21 PM
how to sleep /create interval in kernel module? b123coder Programming 3 01-04-2005 10:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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