Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


Closed Thread
  Search this Thread
Old 09-16-2009, 09:43 AM   #1
LQ Newbie
Registered: Sep 2009
Posts: 4

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


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?


Last edited by oblix; 09-16-2009 at 09:56 AM. Reason: problem solved
Old 09-16-2009, 09:55 AM   #2
LQ Newbie
Registered: Sep 2009
Posts: 4

Original Poster
Rep: Reputation: 0
OK found answer, the path cannot be relative it has to be absolute path.
Old 09-17-2009, 08:35 PM   #3
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Glad you solved it---next time, only one thread, please

Closed Thread

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
[SOLVED] How to add include path to kernel module Makefile oblix Linux - Kernel 2 09-16-2009 10:09 AM
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 > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:49 PM.

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