[Top][All Lists]

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

Re: levels of substitution limits?

From: Paul D. Smith
Subject: Re: levels of substitution limits?
Date: Wed, 29 Oct 2003 22:02:21 -0500

%% Soren A <address@hidden> writes:

  sa> I've hit a little snag that baffles me and I wonder how to work
  sa> around it.

  sa> I have a makefile that gets make variables declared in another
  sa> makefile by using $(shell egrep [...]) and that's not something I
  sa> can change.

I'll need to see more info than this: exactly how does it use this?

  sa> The string that is found is assumed by this makefile (call it
  sa> "rules", bec.  that's its name) to be a simple string,
  sa> i.e. something like "foo-4.6.2". But in one case I want to use, in
  sa> the second makefile, an assignment for a macro variable that
  sa> contains in itself a make function call:

  sa>   MACRO =-$(shell /bin/date '+%Y%m%d')-1

  sa> In "rules", the $(MACRO) isn't being "evaluated". I get a strange
  sa> error message though:

  sa>   /bin/sh: shell: command not found

  sa> I have a feeling this error message doesn't indicate at all what's
  sa> really going on and should be ignored.

I don't think so.  In POSIX shells, $(...) is a synonym for `...`.  So
the fact you're seeing this error message implies to me that somehow
your make variable setting line is being evaluated by the shell, as if
it were:

  MACRO =-`shell ...`-1

and that's why you get the "shell: command not found" error.

I can't really give you more help than that until I know a little bit
more about how the variables are set in the makefile.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "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]