Nios® II Software Developer Handbook

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

16.4.2. 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"