Embedded Design Handbook

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

4.1.5. Rebuilding Software from the Command Line

Rebuilding software after minor source code edits does not require a GUI. You can rebuild the project from a Nios® II Command Shell, using your application's makefile. To build or rebuild your software, perform the following steps:

  1. Open a Nios® II Command Shell by executing one of the following steps, depending on your environment:
    • In the Windows operating system, on the Start menu, point to Programs > Intel FPGA > Nios® II EDS, and click Nios® II Command Shell.
    • In the Linux operating system, in a command shell, type the following sequence of commands:
      cd <
                     Nios® II EDS install path>
      ./nios2_command_shell.sh
  2. Change to the directory in which your makefile is located. If you use the Nios® II SBT for development, the correct location is often the Debug or Release subdirectory of your software project directory.
  3. In the Command Shell, type one of the following commands:

    make

    or

    make -s

The example below illustrates the output of the make command run on a sample system.

Sample Output From make -s Command

$ make -s
Creating generated_app.mk...
Creating generated_all.mk...
Creating system.h...
Creating alt_sys_init.c...
Creating generated.sh...
Creating generated.gdb...
Creating generated.x...
Compiling src1.c...
Compiling src2.c...
Compiling src3.c...
Compiling src4.c...
Compiling src5.c...
Linking project_name.elf...

If you add new files to your project or make significant hardware changes, recreate the project with the original tool (the Nios® II SBT). Recreating the project recreates the makefile for the new version of your system after the modifications.