help-make
[Top][All Lists]
Advanced

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

Re: help: wildcards in rules


From: Paul Smith
Subject: Re: help: wildcards in rules
Date: Thu, 02 Aug 2007 15:04:02 -0400

On Thu, 2007-08-02 at 10:37 -0400, German Salazar wrote:
> $(fobjs): $(wdir)/%.o: %.[fF]*       <<<< my problem
>       $(COMPILE.f) $< -o $@

> I am having difficulties implementing the $(fobjs) target since
> %.[fF]* does not do what I was hoping for. The thing is that a given
> *.o file (from fobjs) may need to be generated from a *.f or *.F or
> *.f77 or *.f90 file, and I wanted to automate that part, too, of
> course...any alternate way on how to go about this that will still
> take advantage of the ability of make of not having to compile
> everything every time, but only what is necessary?

Please always reply to the mailing list rather than to me directly, that
way others can help you if I'm unavailable and the answers are available
in the archives if other people are searching.

Anyway, the only way to do what you want is to declare four different
rules.  I don't know why you're using static pattern rules here instead
of regular pattern rules, but I think you need to rewrite your example
above to be this:

$(wdir)/%.o: %.f
        $(COMPILE.f) $< -o $@
$(wdir)/%.o: %.F
        $(COMPILE.f) $< -o $@
$(wdir)/%.o: %.f77
        $(COMPILE.f) $< -o $@
$(wdir)/%.o: %.f90
        $(COMPILE.f) $< -o $@

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