Nios® II Software Developer Handbook

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

5.4.1.2. Copying, Moving, or Renaming a BSP

BSP makefiles have only relative path references to project source files. Therefore you are free to copy, move, or rename the entire BSP. If you specify a relative path to the SOPC system file when you create the BSP, you must ensure that the .sopcinfo file is still accessible from the new location of the BSP. This .sopcinfo file path is stored in the BSP settings file.

Run make clean when you copy, move, or rename a BSP. The make dependency files (.d) have absolute path references. make clean removes the .d files, as well as linker object files (.o) and .a files. You must rebuild the BSP before linking an application with it. You can use the make clean_bsp command to combine these two operations.

For more information about .d files, refer to the GNU make documentation, available from the Free Software Foundation, Inc. website.

Another way to copy a BSP is to run the nios2-bsp-generate-files command to populate a BSP directory and pass it the path to the BSP settings file of the BSP that you wish to copy.

If you rename or move a BSP, you must manually revise any references to the BSP name or location in application or user library makefiles.