Nios II Classic Software Developer’s Handbook

ID 683282
Date 5/14/2015
Public
Document Table of Contents

7.8.5.2.8. Adding Include Paths

By default, the generated BSP Makefile and public.mk add include paths to find header files in /inc or <BSP type>/inc folders.

You might need to set up a header file directory hierarchy to logically organize your code. You can add additional include paths to your driver or software package using the add_sw_property command’s include_directory argument as follows:

add_sw_property include_directory UCOSII/inc/protocol/h

Note: If the path begins with the BSP type (e.g HAL or UCOSII), the BSP type is removed and replaced with the value of the bsp_subdirectory property.

Additional include paths are added to the preprocessor flags in the BSP public.mk file. These preprocessor flags allow BSP source files, as well as application and user library source files that reference the BSP, to find the include path while each source file is compiled.

Note: Adding additional include paths is not required if your source code includes header files with explicit path names. You can also specify the location of the header files with a #include directive similar to the following:

#include "protocol/h/ <filename>"