Makefile: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
Solar (talk | contribs)
A quick review as I start to reference this tutorial from elsewhere.
Solar (talk | contribs)
→‎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: