On Tue, Feb 24, 2004 at 12:01:43PM +0100, Jean-Marc Lasgouttes wrote:
> 
> What about asking on the automake list whether there is some provision
> to do what we want to do?
> 
> And what is the main problem in this rule? The fact that append _moc
> to the name? Do we really need to do that?

No.  If you have such a rule:

%.h: %.ui
        $(UIC) $(UICFLAGS) $< -o $@

it can be easily replaced (and that works in every make) with:

.SUFFIXES:      .h .ui

.ui.h:
        $(UIC) $(UICFLAGS) $< -o $@

But the rule like this

%_moc.C: $(srcdir)/../%.h
        $(MOC) -o $@ $<

cannot.  Not because of _moc.C.  You can put _moc.C in the SUFFIXES
rule.  The problem is the path in front of .h that can't go in the
SUFFIXES rule ($(srcdir)/../).

Even worse is the third case we have there:

%.C: %.h %.ui
        $(UIC) $(UICFLAGS) -impl $^ -o $@

This is basically, telling that you make X.C file using X.h file, but
they also depend on X.ui.  You can't do that with suffix rules.

.h.C: X.ui

is a wrong syntax.  Plus, X has to be different every time.

BSD make saves the day with the .for loop.
Is there something like that in SysV make.
I don't really remember.  Last time I used SysV make was back in 1995.
:-)

-- 
Zvezdan Petkovic <[EMAIL PROTECTED]>
http://www.cs.wm.edu/~zvezdan/

Reply via email to