Skip to contentSkip to conversation

Compiling External Modules - Local Include Files

DISCUSSION Chirag Pandya 2 participants 2 messages Aug 10, 2004

lore
Share & tools
lore
#0 lore raw

I'm having trouble recompiling my 2.4 modules that contain local include files. Here is the scenario:
Dir contents
------------
/home/radar/dirA/local.h /home/radar/dirB/main.c /home/radar/dirB/Makefile

main.c
------
#include "dirA/local.h"
main ()
{
/* Module Code*/
}

Using the following make command

# make -C /usr/src/linux-2.6.7 M=$(PWD) modules

I get the following error messages
Entering directory /usr/src/linux-2.6.7
CC [M] /home_dir/dirB/main.c:15:32: dirA/local.h: No such file or directory

Obviously when I am in /usr/src/linux-2.6.7 I cannot see local.h.

I noticed that PATCH 5/5 contains an extmodules.txt document with but with a "local includes" section still blank under TODO.

Any help on how I can fix this?
Thanks

__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

#1 lore raw

Please add lkml on cc: when sending mails direct. I nthis way the list readers also see the response.

Quoted 16 lines · Chirag Pandya

I'm having trouble recompiling my 2.4 modules that contain local include files. Here is the scenario:
Dir contents
------------
/home/radar/dirA/local.h /home/radar/dirB/main.c /home/radar/dirB/Makefile

main.c
------
#include "dirA/local.h"
main ()
{
/* Module Code*/
}

Quoted 2 lines

Using the following make command

# make -C /usr/src/linux-2.6.7 M=$(PWD) modules

As explained in private mail two options exists:
1) Restructure your code to have .h file in either the same dir as your code, and in a sub-directory to the location of your .c files.

2) Use
EXTRA_CFLAGS := -I..

I recommend 1).

Sam