%% Massimiliano Cialdi <[EMAIL PROTECTED]> writes:

  mc> %m: %n
  mc>   @echo "*$<* ... *$(FILES)* ... *$(findstring $<,$(F))*"
  mc> ifeq ($<,$(findstring $<,$(F)))
  mc>   @echo "++$<==$(findstring $<,$(F))++"
  mc> else
  mc>   @echo "++$<!=$(findstring $<,$(F))++"
  mc> endif

You can't do this.

Make parses makefiles in two steps: first it reads the entire makefile
and constructs an internal graph.

Second it walks that graph and invokes the rules needed to build the
out-of-date targets it finds during that walk.

The make preprocessor commands like ifeq, etc. are all parsed during the
first step.

The contents of the automatic variables like $<, etc. are only valid
during the second step, when the rule is being invoked.

So, your ifeq statement is the same as this (since $< is always empty
during the first step):

  ifeq (,$(findstring ,$(F)))


If you want to write conditions that execute inside a rule based on the
target/prerequisite values of that rule, you _MUST_ use shell
conditionals, not make conditionals:

%m: %n
        @echo "*$<* ... *$(FILES)* ... *$(findstring $<,$(F))*"
        @case "$<" in $(findstring $<,$(F))) echo found; *) echo not found; esac

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to