Nios® II Software Developer Handbook

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

16.1.9. nios2-lib-generate-makefile

Usage

nios2-lib-generate-makefile [--bsp-dir <directory>] 
 [--debug] [--extended-help] [--help] 
 [--lib-dir <directory>] [--lib-name <filename>] 
 [--log <filename>] [--no-src] 
 [--public-inc-dir <directory>] [--set <name> <value>]
 [--silent] [--src-dir <directory>] 
 [--src-files <filenames>] [--src-rdir <directory>]
 [--use-lib-dir <directory>] [--verbose] 
 [--version]

Options

  • --bsp-dir <directory>: Path to the BSP generated files directory (populated using the nios2-bsp-generate-files command).
  • --debug: Output debug, exception traces, verbose, and default information about the command's operation to stdout.
  • --extended-help: Displays full information about this command and its options.
  • --help: Displays basic information about this command and its options.
  • --lib-dir <directory>: Destination directory for the user library archive file (.a), the user library makefile, and public.mk. If omitted, it defaults to the current directory.
  • --lib-name <filename>: Name of the user library being created. The user library file name is the user library name with a lib prefix and .a suffix added. Do not include these in the user library name itself. If the user library name option is omitted, the user library name defaults to the name of the first source file with its extension removed.
  • --log <filename>: Create a debug log and write to specified file. Also logs debug information to stdout.
  • --no-src: Allows no sources files to be set in the Makefile. You must add source files manually before compiling.
  • --public-inc-dir <directory>: Path to a directory that contains C header files (.h) that are to be made available (that is, public) to users of the user library. This directory is added to the appropriate variable in public.mk. Multiple --public-inc-dir options are allowed.
  • --set <name> <value>: Set the makefile variable called <name> to <value>. If the variable exists in the managed section of the makefile, <value> replaces the default settings. It adds the makefile variable if it does not already exist. Multiple --set options are allowed.
  • --silent: Suppress information about the command's operation normally sent to stdout.
  • --src-dir <directory>: Search for source files in <directory>. Use . to look in the current directory. Multiple --src-dir options are allowed.
  • --src-files <filenames>: A list of space-separated source file names added to the makefile. The list of file names is terminated by the next option or the end of the command line. Multiple --src-files options are allowed.
  • --src-rdir <directory>: Same as --src-dir option but recursively search for source files in or under <directory>. Multiple --src-rdir options are allowed and can be freely mixed with --src-dir options.
  • --use-lib-dir <directory>: Path to a dependent user library directory. The user library directory must contain a makefile fragment called public.mk. Multiple --use-lib-dir options are allowed.
  • --verbose: Output verbose, and default information about the command's operation to stdout.
  • --version: Displays the version of this command and exits with a zero exit status.

Description

The nios2-lib-generate-makefile command generates a user library makefile (called Makefile). The path to a BSP created by nios2-bsp-generate-files is an optional command-line option.

If no command-line arguments are specified, this command returns an exit value of 1 and sends a help message to stderr.

Note:

For more information about this command, use the --extended-help option to display comprehensive usage information.