Managing Projects with GNU Make (Nutshell Handbooks)

     

An empty command is one that does nothing.

header.h: ;

Recall that the prerequisites list for a target can be followed by a semicolon and the command. Here a semicolon with nothing after it indicates that there are no commands. You could instead follow the target with a line containing only a tab, but that would be impossible to read. Empty commands are most often used to prevent a pattern rule from matching the target and executing commands you don't want.

Note that in other versions of make , empty targets are sometimes used as phony targets. In GNU make , use the .PHONY special target instead; it's safer and clearer.

Категории