bug-make
[Top][All Lists]
Advanced

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

[bug #47913] newlines lost with $(foreach)


From: Brian Vandenberg
Subject: [bug #47913] newlines lost with $(foreach)
Date: Mon, 16 May 2016 13:51:18 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #4, bug #47913 (project make):

You could get the same behavior as before as long as the dependency list is
exactly 1 file:


define ASDF =
Filee.cpp:File.h
Other.cpp:Other.h
endef

SPACE:=
SPACE:=${SPACE} ${SPACE}
here = here
$(foreach x,${ASDF},$(subst ${SPACE},:,$(foreach y,$(subst
:,${SPACE},${ASDF}),$(abspath ${here}/${y}))))


... though I would probably be more inclined to abandon that approach in favor
of something like:


# Usage:
#   $(call MAKE_DEPS, list of source files, list of header dependencies)
define MAKE_DEPS =
$(if $(filter undefined,$(origin 1) $(origin 2)),,$(if ${1},$(if ${2},$(eval
$(foreach x,${1},$(abspath ${here}/${x})) : $(foreach x,${2},$(abspath
${here}/${x}))))))
endef

# ...

$(call MAKE_DEPS, File.cpp, File.h)
$(call MAKE_DEPS, Other.cpp, Other.h)
$(call MAKE_DEPS, File.cpp Other.cpp, Test.h Blah.h Stuff.h)




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?47913>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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