Include file paths

Joel Sherrill joel.sherrill at
Thu Jul 5 20:59:01 UTC 2001

> "Hennenfent, Nick {AVL~Roswell}" wrote:
> Can anyone tell me how RTEMS specifies include file paths?
> I see where PROJECT_INCLUDE gets defined but how does
> this get seen by gcc??? I am most familiar with using the -I
> argument for gcc.

Ralf will probably weigh in on this one as well. :)

RTEMS uses the -B option to make gcc think that RTEMS .h files
are part of its standard ones.  We use the -B in conjunction
with the -specs option to simplify the arguments required
to compile and link an application for a BSP.  The -specs
option did not exist prior to gcc 2.8.0 and before that
we explicitly specified the include path this way:

# Ask gcc where it finds its own include files
GCC_INCLUDE=$(shell $(CC) $(CPU_CFLAGS) -print-file-name=include

CPPFLAGS += -nostdinc \
  -I$(RTEMS_LIBC_DIR)/sys-include \

This says  RTEMS .h's for this BSP first, then the compiler files,
then the C library.
> Thanks

Joel Sherrill, Ph.D.             Director of Research & Development
joel at                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985

More information about the users mailing list