Specifications
You can add multiple directories by enclosing them in double quotes, for example --set
APP_LIBRARY_DIRS "../my_libs ../../other_libs".
• APP_LIBRARY_NAMES—Use this variable to specify the names of additional libraries that your applica‐
tion must link with. Library files are .a files.
Note: You do not specify the full name of the .a file. Instead, you specify the user library name <name>,
and the SBT constructs the filename lib<name>.a. For example, if you add the string "math" to
APP_LIBRARY_NAMES, the SBT assumes that your library file is named libmath.a.
Each specified user library name is passed to the linker with the -l option. The paths to locate these
libraries must be specified in the APP_LIBRARY_DIRS variable.
Note: You cannot use this variable to specify a BSP or user library created with the SBT. The paths to
these libraries are specified in public.mk file included in the application makefile.
• BUILD_PRE_PROCESS—This variable allows you to specify a command to be executed prior to building
the application, for example,
cp *.elf ../lastbuild.
• BUILD_POST_PROCESS—This variable allows you to specify a command to be executed after building
the application, for example,
cp *.elf //production/test/nios2executables.
User Library Makefile Variables
You can modify the following user library makefile variables on the command line:
• LIB_CFLAGS_DEFINED_SYMBOLS—This variable allows you to define macros using the -D argument, for
example -D <macro name>. The contents of this variable are passed to the compiler and linker
without modification.
• LIB_CFLAGS_UNDEFINED_SYMBOLS—This variable allows you to remove macro definitions using the -U
argument, for example -U <macro name>. The contents of this variable are passed to the compiler and
linker without modification.
• LIB_CFLAGS_OPTIMIZATION—The C/C++ compiler optimization level. For example, -O0 provides no
optimization and -O2 provides standard optimization. -O0 is recommended for debugging code,
because compiler optimization can remove variables and produce non-sequential execution of code
while debugging.
• LIB_CFLAGS_DEBUG_LEVEL—The C/C++ compiler debug level. -g provides the default set of debug
symbols typically required to debug an application. Omitting -g omits debug symbols from the .elf.
• LIB_CFLAGS_WARNINGS—The C/C++ compiler warning level. -Wall is commonly used, enabling all
warning messages.
• LIB_CFLAGS_USER_FLAGS
• LIB_INCLUDE_DIRS—You can add multiple directories by enclosing them in double quotes, for
example --set LIB_INCLUDE_DIRS
"../my_includes ../../other_includes"
Standard Build Flag Variables
The SBT creates makefiles supporting the following standard makefile command-line variables:
• CFLAGS
• CPPFLAGS
• ASFLAGS
• CXXFLAGS
You can define flags in these variables on the makefile command line, or in a script that invokes the
makefile. The makefile passes these flags on to the corresponding GCC tool.
NII5V2
2015.05.14
User Library Makefile Variables
15-63
Nios II Software Build Tools Reference
Altera Corporation
Send Feedback