If I use this Makefile ...

bash$ cat Makefile
FOO := $(shell echo $(ENTRIES) ; )
BAR := $(shell echo $(ENTRIES)   )

        @echo FOO = $(FOO)
        @echo BAR = $(BAR)

.PHONY: all

... and set ENTRIES with embedded newlines, then this happens:

bash$ make 'ENTRIES=
FOO = blartzblurfl
BAR = blartz blurfl

Why is the embedded whitespace removed in the first (FOO) case?  It seems 
related to the semicolon shell metacharacter ...

bash$ make --version
GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.



  • embedded newl... Byrnes, Robert

Reply via email to