From: Wolfgang Denk Date: Thu, 12 May 2011 22:30:34 +0200 Subject: [U-Boot] [PATCH] Fix variable flavor in examples/standalone/Makefile In-Reply-To: References: Message-ID: <20110512203034.F10A4D6F24F@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Che-liang Chiou, In message you wrote: > GNU Makefile have two flavors of variables, recursively expanded that is > defined by using '=', and simply expanded that is defined by using ':='. > > The bug is caused by using recursively expanded flavor for BIN and SREC. > As you can see below, they are prepended by $(obj) twice. > > We can reproduce this bug with a simplified version of this Makefile: > $ cat > Makefile < obj := /path/to/obj/ > ELF := hello_world > > BIN_rec = $(addsuffix .bin,$(ELF)) # recursively expanded > BIN_sim := $(addsuffix .bin,$(ELF)) # simply expanded > > ELF := $(addprefix $(obj),$(ELF)) > BIN_rec := $(addprefix $(obj),$(BIN_rec)) > BIN_sim := $(addprefix $(obj),$(BIN_sim)) > > show: > @echo BIN_rec=$(BIN_rec) > @echo BIN_sim=$(BIN_sim) > > .PHONY: show > EOF > $ make show > BIN_rec=/path/to/obj//path/to/obj/hello_world.bin > BIN_sim=/path/to/obj/hello_world.bin > > Signed-off-by: Che-Liang Chiou > --- > > examples/standalone/Makefile | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de It all seemed, he thought, to be rather a lot of trouble to go to just sharpen a razor blade. - Terry Pratchett, _The Light Fantastic_