Specifications
User-Managed Source Files
When you import a Nios II application or user library project, the Nios II SBT for Eclipse offers the
option of user source management. User source management is helpful if you prefer to update your
makefile manually to reflect source files added to or removed from the project.
With user source management, Eclipse never makes any changes to the list of source files in your
makefile. However, the SBT for Eclipse manages all other project parameters and settings, just as with any
other Nios II software project.
If your makefile refers to a source file with an absolute path, when you import with user source
management, the absolute path is untouched, like any other source path. You might use an absolute path
to refer to common source files in a fixed location. In this situation, you can move the project to a
different directory without disturbing the common source file references.
User source management is not available with BSP projects. BSP makefiles are based on the operating
system, BSP settings, selected software packages, and selected drivers. You do not specify BSP source files
directly.
Related Information
User Source Management on page 2-13
For more information about how the SBT for Eclipse handles makefiles with user-managed sources.
Packaging a Library for Reuse
This section shows how to create and use a library archive file (.a) in the Nios II Software Build Tools for
Eclipse. This technique enables you to provide a library to another engineer or organization without
providing the C source files. This process entails two tasks:
1. Create a Nios II user library
2. Create a Nios II application project based on the user library
Creating the User Library
To create a user library, perform the following steps:
1. In the File menu, point to New and click Nios II Library.
2. Type a project name, for example test_lib.
3. For Location, browse to the directory containing your library source files ( .c and .h).
4. Click Finish.
5. Build the project to create the .a file (in this case libtest_lib.a).
Using the Library
To use the library in a Nios II application project, perform the following steps:
1. Create your Nios II application project.
2. To set the library path in the application project, right-click the project, and click Properties.
3. Expand Nios II Application Properties. In Nios II Application Paths, next to Application include
directories, click Add and browse to the directory containing your library header files.
4. Next to Application library directories, click Add and browse to the directory containing your .a file.
NII5V2
2015.05.14
User-Managed Source Files
2-25
Getting Started with the Graphical User Interface
Altera Corporation
Send Feedback