Nios® II Software Developer Handbook

ID 683525
Date 8/28/2023
Public
Document Table of Contents

5.2. Makefiles

Makefiles are a key element of Nios® II C/C++ projects. The Nios® II SBT includes powerful tools to create makefiles. An understanding of how these tools work can help you make the most optimal use of them.

The Nios® II SBT creates two kinds of makefiles:

  • Application or user library makefile—A simple makefile that builds the application or user library with user-provided source files
  • BSP makefile—A more complex makefile, generated to conform to user-specified settings and the requirements of the target hardware system

It is not necessary to use to the generated application and user library makefiles if you prefer to write your own. However, Intel FPGA recommends that you use the SBT to manage and modify BSP makefiles.

Generated makefiles are platform-independent, calling only utilities provided with the Nios® II EDS (such as nios2-elf-gcc).

The generated makefiles have a straightforward structure, and each makefile has in-depth comments explaining how it works. Intel FPGA recommends that you study these makefiles for further information about how they work. Generated BSP makefiles consist of a single main file and a small number of makefile fragments, all of which reside in the BSP directory. Each application and user library has one makefile, located in the application or user library directory.