Datasheet

Book VIII
Chapter 1
Programming
in Linux
543
Exploring the Software-Development Tools in Linux
Option Meaning
-m
Ignores the variable given but accepts that variable for compatibil-
ity with other versions of make.
-n
Prints the commands to execute but does not execute them.
-o FILE Does not rebuild the file named FILE, even if it is older than its
dependents.
-p Displays the make database of variables and implicit rules.
-q
Does not run anything, but returns 0 (zero) if all targets are up to
date, 1 if anything needs updating, or 2 if an error occurs.
-r
Gets rid of all built-in rules.
-R
Gets rid of all built-in variables and rules.
-s
Works silently (without displaying the commands as they execute).
-t
Changes the timestamp of the files.
-v Displays the version number of make and a copyright notice.
-w
Displays the name of the working directory before and after pro-
cessing the makefile.
-W FILE Assumes that the specified file has been modified (used with -n to
see what happens if you modify that file).
The GNU debugger
Although make automates the process of building a program, that part of
programming is the least of your worries when a program doesn’t work cor-
rectly or when a program suddenly quits with an error message. You need
a debugger to find the cause of program errors. Linux includes gdb — the
versatile GNU debugger with a command-line interface.
Like any debugger, gdb lets you perform typical debugging tasks, such as
the following:
Set a breakpoint so that the program stops at a specified line
Watch the values of variables in the program
Step through the program one line at a time
Change variables in an attempt to correct errors
The gdb debugger can debug C and C++ programs.
42_770191-bk08ch01.indd 54342_770191-bk08ch01.indd 543 8/6/10 9:51 AM8/6/10 9:51 AM