makefile的调试

    技术2025-04-21  21

     

     

     

    make有用的选项:

     

    -d   Print debugging information in addition to normal processing.  The debugging information says which files are being considered for remaking,  which

                file-times  are  being  compared  and  with what results, which files actually need to be remade, which implicit rules are considered and which are

                applied---everything interesting about how make decides what to do.

     

    --debug[=FLAGS]

                Print debugging information in addition to normal processing.  If the FLAGS are omitted, then the behavior is the same  as  if  -d  was  specified.

                FLAGS  may  be  a  for  all  debugging output (same as using -d), b for basic debugging, v for more verbose basic debugging, i for showing implicit

                rules, j for details on invocation of commands, and m for debugging while remaking makefiles.

     

    -p, --print-data-base

                Print the data base (rules and variable values) that results from reading the makefiles; then execute as usual or  as  otherwise  specified.   This

                also  prints  the  version  information given by the -v switch (see below).  To print the data base without trying to remake any files, use make -p

                -f/dev/null.

     

    -n, --just-print, --dry-run, --recon

                Print the commands that would be executed, but do not execute them.

     

    --no-print-directory

                Turn off -w, even if it was turned on implicitly.

     

    -q, --question

                ‘‘Question  mode’’.  Do not run any commands, or print anything; just return an exit status that is zero if the specified targets

                are already up to date, nonzero otherwise

     

    -s, --silent, --quiet

                Silent operation; do not print the commands as they are executed.  

     

    --warn-undefined-variables

                Warn when an undefined variable is referenced.    

     

     

     

     

    make -n xxxx 

    如果嫌内容太多,可以过滤掉多余的信息:

    make -n xxxx | grep “make -f” 

     

     

     

    最新回复(0)