Next: , Previous: , Up: Data   [Contents][Index]


4.7.3 Examining Targets (‘target’, ‘list’)

the GNU Make debugger can print information about targets. When the GNU Make debugger enters the debugger, the GNU Make debugger spontaneously prints the target name under consideration and the location of this target. Likewise, when you select a target frame (see Selecting a frame), the GNU Make debugger the default target name is changed.

As with debugging any program, the value shown at a particular point in time may change. Targets, and commands can use GNU Make uses variables and these values can change.

target
t

print information about the current target.

target target
t target

Print information about target. A list of attributes can be specified after the target name. The list of attributes names are

attributes

Show the list of “attributes” associated with the target. Attributes can be:

  • implicit rule search has been done
  • phony: has no file associated with it
  • precious:
  • a command-line target
commands

Show the list of commands that need to get run in order to bring the target up to date.

depends

Show the targets that this one depends on.

expand

Show the list of commands that need to get run in order to bring the target up to date with GNU Remake variables expanded.

nonorder

Show the “non-order” dependencies, i.e. dependencies that are not ordered.

previous

Previous target name when there are multiple double-colons

state

Show target status:

  • Successfully updated
  • Needs to be updated
  • Failed to be updated
  • Invalid - error of some sort
time

This shows the time that the file was last modified and if the file has been brought up to date. If it is not up to date you will see the message “File is very old.” If a target is “phony”, i.e. doesn’t have file associated with it, the message “File does not exist.” will appear instead of the time. In some cases you may see “Modification time never checked.”

variables

Show single-character automatic state variables (if defined):

  • @ - the target name
  • % - target member name, when target is an the archive member
  • * - the stem with which an implicit rule matches
  • + - like $^ but with the duplicate dependencies listed in order
  • < - the name of the first prerequisite
  • ^ - the names of all prerequisites (no duplicates)
  • ? - the names of all prerequisites newer than the target (@)

Note that there are other automatic variables defined based on these. In particular those that have a ‘D’ or ‘F’ suffix, e.g. $(@D), or $(*F). These however are not listed here but can shown in a print command or figured out from their corresponding single-letter variable name.

list
l

The “list” is like target but only text-oriented information is shown.


Next: , Previous: , Up: Data   [Contents][Index]