automake
[Top][All Lists]
Advanced

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

Re: I: adjust test suite for upcoming GNU Make 3.83


From: psmith
Subject: Re: I: adjust test suite for upcoming GNU Make 3.83
Date: 05 Jul 2005 09:31:10 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

%% Alexandre Duret-Lutz <address@hidden> writes:

  adl> The user lists filenames in variables, and Automake uses these 
  adl> variables in both prerequisite lists or commands.  For instance
  adl> see $(dist_my_DATA) in the last excerpt of
  adl> http://lists.gnu.org/archive/html/automake/2005-03/msg00067.html

Well, if you can assume GNU make syntax you can easily convert my
example into a subst call so that the contents of the variables don't
have to change, like this:

Same as before:

  ifeq (,$(filter second-expansion,$(.FEATURES)))
     # GNU make <3.81
     PRE_D := $$
  else
     # GNU make >=3.81
     PRE_D := $$$$
  endif

Then whenever you have prerequisites that might contain $ you would wrap
it in a subst call like this:

  install-dist_myDATA: $(subst $$,$(PRE_D),$(dist_my_DATA))

I've tested this by hand and it works.

The trick will be knowing when to generate this GNU make-specific
content into the makefile, and when you can avoid it... I assume you'd
only want to generate it when you have filenames containing $.

  adl> So any solution that require a syntax that is different in
  adl> prerequisites than it is in the commands seems wrong to me.

I definitely agree that this incongruity is disturbing, but that's the
way it is.

Hopefully the next version of GNU make will have some more generic
mechanism for quoting that will handle ALL different "special
characters" that might appear in filenames, including colons and
whitespace as well as dollar signs.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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