Ken Mankoff wrote:
# So... why doesn't this work?
%.o: %.f
ifeq ($(findstring $@,$(OBJ)),)
        @echo not found
else
        @echo found
endif

Because the ifeq is processed when the Makefile is being parsed and not when rules are run. In that case $@ is empty and hence this won't work. You can't use ifeq to change the body of a rule at run time.

But you could use $(if) instead:

    %.o: %.f
        @echo $(if $(findstring $@,$(OBJ)),found,not found)

John.
--
John Graham-Cumming
[EMAIL PROTECTED]

Home: http://www.jgc.org/
Blog: http://www.jgc.org/blog/

POPFile: http://getpopfile.org/
GNU Make Standard Library: http://gmsl.sf.net/
GNU Make Debugger: http://gmd.sf.net/
Fast, Parallel Builds: http://www.electric-cloud.com/

Sign up for my Spam and Anti-spam Newsletter
at http://www.jgc.org/

Help out in the fight against spam
http://www.spamorham.org/


_______________________________________________
Help-make mailing list
Help-make@gnu.org
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to