[Top][All Lists]

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

Re: findstring & ifeq

From: Paul D. Smith
Subject: Re: findstring & ifeq
Date: Thu, 11 May 2006 08:19:38 -0400

%% Ken Mankoff <address@hidden> writes:

  km> On Wed, 10 May 2006, Ken Mankoff wrote:
  >> I'm trying to do conditional compilation using findstring and ifeq 
  >> in the makefile, but having errors. Can anyone advise how to best 
  >> do this?

  km> My apologies for not searching the list archives more thoroughly. 
  km> The solution is like so:

  km> %.o: %.f
  km>   $(if $(findstring $@,$(OBJ)),   \
  km>           $(FC) $(FFLAGS) $<,     \
  km>           $(FCMP) $(FFLAGSMP) $<)

Just a note: I would definitely avoid findstring here.  It will find any
_substring_.  It's obviously unlikely that a <...>.o string will appear
inside another word in OBJ; nevertheless ...

You should use the filter and filter-out functions (in this case you
want filter) to match entire words.

 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]