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/latest_cvs_commit.sh 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). Cheers, Ralf