LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices



Reply
 
Search this Thread
Old 09-15-2009, 05:02 PM   #1
oblix
LQ Newbie
 
Registered: Sep 2009
Posts: 4

Rep: Reputation: 0
Question How to add include path to kernel module Makefile


Hello

I have probably a stupid question. How do I add an include path for kernel module makefile? I want to include "test_kernel.h" in test_module.c
test_kernel.h resides in a different directory with relative path "../../common/" . I can include the file specifying the relative path, which works OK:

#include "../../common/test_kernel.h"

I would like include it without the relative path and specify path in Makefile similar to -I option available in application makefiles. I have tried EXTRA_CFLAGS += -I../../common/ in the makefile but no use. Any suggestions?

Thanks!
 
Old 09-16-2009, 09:59 AM   #2
oblix
LQ Newbie
 
Registered: Sep 2009
Posts: 4

Original Poster
Rep: Reputation: 0
SOLVED

Relative paths don't work. It has to be absolute path.
eg EXTRA_CFLAGS += -I$(PWD)/../../common/
 
Old 09-16-2009, 10:09 AM   #3
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by oblix View Post
SOLVED

Relative paths don't work. It has to be absolute path.
eg EXTRA_CFLAGS += -I$(PWD)/../../common/
Hi oblix,

Welcome to LQ

If your issue is really solved, you can if you like, use the "Thread Tools" menu near the top of the page, and officially mark the thread [solved]

Also, I noticed that you posted your thread in more than one forum; please do not do that -- if you discover that you should have posted your question in a different place, please use the REPORT button and ask for it to be moved for you
I'll have your other thread closed.

Thanks!
Sasha

Last edited by GrapefruiTgirl; 09-16-2009 at 10:11 AM.
 
  


Reply

Tags
makefile, modules


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
old 2.4 kernel module makefile reuse kannankvs Programming 0 08-18-2009 08:54 PM
need help in writing Makefile for module in 2.6 kernel videsh Programming 1 01-19-2006 08:35 AM
recompile kernel to include module samfrog88 Linux - Software 1 01-06-2005 07:28 PM
Use mkinitrd to include module in kernel Travers Linux - Newbie 1 07-23-2004 03:35 PM
module makefile for c++ in kernel 2.6 yuhuahe Linux - Software 0 04-14-2004 07:03 PM


All times are GMT -5. The time now is 10:24 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration