From f2583a9960f41a04eebbf96efcd1c31a2f97d214 Mon Sep 17 00:00:00 2001 From: Shreyas Chand Date: Tue, 15 Jan 2019 22:59:49 -0800 Subject: [PATCH 1/2] Correct description of ":=" and "=" operators The description of the ":=" and "=" assignment operators were flipped. As documented in the GNU make manual (https://www.gnu.org/software/make/manual/make.html#Reading-Makefiles), the ":=" assignment operatory is the immediate assignment operation and "=" is the deferred assignment operation. This change switches the descriptions to correspond to the correct operator and augments the description to clarify the behaviour. --- makefile.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefile.md b/makefile.md index 9718ba0b9..84abeaa1f 100644 --- a/makefile.md +++ b/makefile.md @@ -8,8 +8,8 @@ category: CLI ## Var assignment ```makefile -uglify = $(uglify) # assignment -compressor := $(uglify) # lazy assignment +uglify = $(uglify) # assignment (right hand side is evaluated when variable is used) +compressor := $(uglify) # immediate assignment (right hand side is evaluated at assignment) prefix ?= /usr/local # safe assignment ``` From 4c2bdaa050093b785b88156ae783e425f7b135fc Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Sun, 20 Jan 2019 14:49:16 +0800 Subject: [PATCH 2/2] Update makefile.md --- makefile.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/makefile.md b/makefile.md index 84abeaa1f..aae603383 100644 --- a/makefile.md +++ b/makefile.md @@ -8,11 +8,13 @@ category: CLI ## Var assignment ```makefile -uglify = $(uglify) # assignment (right hand side is evaluated when variable is used) -compressor := $(uglify) # immediate assignment (right hand side is evaluated at assignment) +uglify = $(uglify) # lazy assignment +compressor := $(uglify) # immediate assignment prefix ?= /usr/local # safe assignment ``` +`=` expressions are only evaluated when they're being used. + ## Magic variables ```makefile