help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

define ... escaped newlines ... endef: bogus space in output


From: gk
Subject: define ... escaped newlines ... endef: bogus space in output
Date: Wed, 23 Apr 2003 18:08:53 -0700

I seem to recall this may have been discussed before.
Is this a bug or a POSIX issue?
The only workaround seems to be to wrap defined macros with $(strip ...)

# Makefile

.PHONY: test
test:
        @echo bug="$(call bug,<- leading space)";
        @echo workaround="$(call workaround,<- no leading space)";

define bug
$(if $(1),\
$(1))
endef

define workaround
$(strip $(if $(1),\
$(1)))
endef
#eof

address@hidden junk]$ make
bug= <- leading space
workaround=<- no leading space


- Greg Keraunen
http://www.xmake.org





reply via email to

[Prev in Thread] Current Thread [Next in Thread]