> # Use LINUXINCLUDE when you must reference the include/ directory.
> # Needed to be compatible with the O= option
> LINUXINCLUDE := -Iinclude \
> - $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include)
> + $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \
> + -imacros include/linux/autoconf.h
>
What is the purpose of using -imacros instead of -iinclude
o -iinclude is much more commonly used for this purpose.
o sparse has limited support(*) for -iinclude today
o -imacros will silently ignore any output caused by the file
Sam
On Wed, Sep 14, 2005 at 06:49:53PM +0200, Sam Ravnborg wrote:
> > # Use LINUXINCLUDE when you must reference the include/ directory.
> > # Needed to be compatible with the O= option
> > LINUXINCLUDE := -Iinclude \
> > - $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include)
> > + $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \
> > + -imacros include/linux/autoconf.h
> >
> What is the purpose of using -imacros instead of -iinclude
>
> o -iinclude is much more commonly used for this purpose.
> o sparse has limited support(*) for -iinclude today
> o -imacros will silently ignore any output caused by the file
autoconf.h should only be macro definitions and should not contain
any code, so -imacros seemed to be the correct tool for the job.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
On Wed, Sep 14, 2005 at 05:53:26PM +0100, Russell King wrote:
> On Wed, Sep 14, 2005 at 06:49:53PM +0200, Sam Ravnborg wrote:
> > > # Use LINUXINCLUDE when you must reference the include/ directory.
> > > # Needed to be compatible with the O= option
> > > LINUXINCLUDE := -Iinclude \
> > > - $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include)
> > > + $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \
> > > + -imacros include/linux/autoconf.h
> > >
> > What is the purpose of using -imacros instead of -iinclude
> >
> > o -iinclude is much more commonly used for this purpose.
> > o sparse has limited support(*) for -iinclude today
> > o -imacros will silently ignore any output caused by the file
>
> autoconf.h should only be macro definitions and should not contain
> any code, so -imacros seemed to be the correct tool for the job.
I will use -iinclude for a start. When sparse has supported -imacros
in a few weeks we can change it if we like. I will update the patch.
Sam