[Rd] GNU make heads-up

From: Dominick Samperi <djsamperi_at_gmail.com>
Date: Tue, 16 Nov 2010 21:21:45 -0500


As most GNU Makefiles (or Makevars) tend to use '=' insead of ':=', I thought it
might be helpful to point out that there is an important difference in the meaning.

When a variable is defined like this:
PKG_CPPFLAGS=whatever
the RHS (whatever) is evaluated every time PKG_CPPFLAGS is used, and this can have undesirable side-effects, especially when whatever is a shell escape.

On the other hand, with
PKG_CPPFLAGS:=whatever
the assignment only happens once, and this is normally what is expected to happen.

Thus it is probably better to use := in most cases.

Dominick

        [[alternative HTML version deleted]]



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 17 Nov 2010 - 02:25:07 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 17 Nov 2010 - 10:40:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive