Re: Compiling External Modules - Local Include Files

From: Sam Ravnborg
Date: Tue Aug 10 2004 - 11:43:07 EST


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

On Tue, Aug 10, 2004 at 08:02:32AM -0700, Chirag Pandya wrote:
> 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

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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/