Makefile: Difference between revisions

→‎Basics: Added a word on := vs. =
[unchecked revision][unchecked revision]
(A quick review as I start to reference this tutorial from elsewhere.)
(→‎Basics: Added a word on := vs. =)
Line 15:
 
A definition declares a variable, and assigns a value to it. Its overall syntax is ''VARIABLE := Value''.
 
'''Note:''' Frequently, you will see declarations with "=" instead of ":=". That is usually a typo; such a variable declaration will result in the assignment being evaluated ''every time the variable is used''. Unless you know exactly what you are doing, use ":=" for variable declarations.
 
A rule defines a ''target'', 0..n ''dependencies'', and 0..n ''commands''. The general idea is that ''make'' checks if the target (file) is there; if it isn't, or any of the dependencies is newer than the target, the commands are executed. The general syntax is:
448

edits