bug-make
[Top][All Lists]
Advanced

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

Re: GNU make 3.81rc1 released -- please test.


From: Paul D. Smith
Subject: Re: GNU make 3.81rc1 released -- please test.
Date: Mon, 20 Feb 2006 15:09:49 -0500

%% James Coleman <address@hidden> writes:

  jc>   Build & install on solaris 2.9 (sparc) using gcc (3.4.5) looks
  jc>   fine. make check all good.  Parallel builds for making make as
  jc>   well as building our stuff.

Good stuff.

  jc> The issue is with echoing a # to file from a Makefile. We use
  jc> $(shell echo "\#...  This gives us a # in the file with make 3.80.
  jc> With make 3.81 we get a \# in the file.  We then include that file
  jc> as a makefile so the \# breaks things.  I think that is a
  jc> bug/feature that was fixed.  Can see some things in ChangeLog that
  jc> might be it but I cannot see exactly what it was.

Hm.  I don't remember offhand changing that exactly, but it's been a
long time since 3.80, and there've been a lot of changes :-/.  I have a
vague recollection of something like this but if I fixed it, it was a
long time ago.  Personally I feel that the old behavior is wrong and
this is simply a bug fix: make was being too aggressive about detecting
make comments, even inside of functions or variables.

  jc> It is easy to fix my particular occurence of this but it has the
  jc> potential to break various Makefiles. So maybe it is a change that
  jc> could cause trouble?  How long has the old behaviour been in make
  jc> I wonder?  Would it be worth a mention in NEWS with a "WARNING:
  jc> Backward-incompatibility" maybe?

  jc> Is it the same issue as the backslash-newline?

No; the backslash-newline stuff is ONLY relevant for commands.  This is
a backslash inside a function.

  jc> $(shell echo "\#STACKS=\"$(STACKS)\" OBSERVERS=\"$(OBSERVERS)\" 
BUILD=\"$(BUILD)\"" > $(COMPONENTS_DETAIL_FILE).new)

  jc> Anyone wishing to have a line beginning with a # has a difficulty.
  jc> Not sure would it be easy to fix and be compatible with both make
  jc> 3.80 and 3.81rc1?

It should be pretty easy: put the "#" in a variable, like this:

    SHC = \#

    $(shell echo "$(SHC)STACKS=\"$(STACKS)\" OBSERVERS=\"$(OBSERVERS)\" 
BUILD=\"$(BUILD)\"" > $(COMPONENTS_DETAIL_FILE).new)

This will work in both 3.80 and 3.81.  Make only checks for either
backslashes or comments in the original text, before expansion.


I'll add a note about this as it's a behavior change, even though I
consider it a bug fix.

-- 
-------------------------------------------------------------------------------
 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]