[Top][All Lists]

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

Re: shell <something>: non-POSIX variable name

From: Ralf Wildenhues
Subject: Re: shell <something>: non-POSIX variable name
Date: Sat, 6 May 2006 17:57:05 +0200
User-agent: Mutt/1.5.11+cvs20060403

Hi Axel,

* Axel Thimm wrote on Fri, May 05, 2006 at 02:45:23PM CEST:
> On Fri, May 05, 2006 at 02:26:05PM +0200, Ralf Wildenhues wrote:
> > 
> > In some cases $(shell xxx) may be replaced by other means, for example a
> > substituted variable computed at configure time, or an Automake
> > conditional, or similar.  But that depends on the specific usage, and
> > won't give you the full flexibility of $(shell ..).
> to get more specific, I'm janitoring a project that uses
> DATE := $(shell date)
> LATEST_CVS := $(shell ../build/ 2>/dev/null) 
> which is later passed as -D defines to fortran 90 code. For C I'd
> stuff it into a file and #include it, but I'm fortran illiterate, so
> I'm looking for a Makefile level fix (e.g. still passing the defines
> through the command line).

Hmm.  You could do
  DATE = `date`

or, a bit less expensive, but requires GNU make,
  DATE := `date`

Probably for LATEST_CVS that is too expensive.  And of course the
semantics are a bit different.  Maybe you can ensure that commits
trigger updating of some stamp file that contains the CVS information,
and then use commands substitution like above again.

CVS Libtool currently uses some kind of stamping based on ChangeLog;
but I don't fully like it because it seems to cause trouble with some
make implementations (Libtool aims to have a portable Makefile, and not
require GNU make).


reply via email to

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