User Tools

Site Tools


development:build:compile

Compile

Commands

  • query recommended compile flags for an application (from /usr/lib/pkgconfig/*.pc)
    pkg-config --cflags "gdk-2.0"
  • generate a pure assembly file with GCC
    gcc -S -c -o test.s test.c
  • generate an assembly file with C source code mixed
    gcc -c -Wa,-a,-ad test.c > test.lst
    • -Wa instructs the GCC to pass the following options to AS
    • -a is a short form of -ahls which instructs the assembler to include assembly (-al), include high-level source (-ah) and to include symbols (-as)
    • -ad omits any debugging directives from listing
  • show all pre-defined GCC preprocessor macros
    cpp -dM /dev/null
  • show defined preprocessor macros (cf. GCC Online Documentation)
    gcc -E -dM <file> 
development/build/compile.txt · Last modified: 2023/07/31 10:51 by Ralf H.