tech-toolchain archive

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

Re: $(<) is used incorrectly in Makefile.kern.inc



On Tue, Aug 19, 2014 at 10:26:26AM +0300, Jarmo Jaakkola wrote:
> Also, in gmake:
>     $<  The name of the first prerequisite. If the target got its recipe
>         from an implicit rule, this will be the first prerequisite added
>         by the implicit rule 
> 
> So the macros would still be wrong, even if it did work like gmake did.
> I suppose it wouldn't be too difficult to make $(<) stand for "the first
> prerequisite" in explicit rules.

I'm sorry, I meant "the dependencies would still be wrong", because
in some cases the order is:
    foo.o: some.h
    foo.o: foo.c
        ${NORMAL_C}

Also, do we want to match what gmake says it does, or what it actually
does?  Making $< stand for the first prerequisite turned out to be
possible and quite easy, but that's not what gmake actually does.
Matching what gmake does might be somewhat more difficult:

    $ cat >Makefile <<EOF
    foo: bar
    foo: baz
        @echo $@: $<, $^, $?
    bar baz:
    EOF
    $ gmake foo
    foo: baz, baz bar, baz bar

As you can see, what it does is "The name of the first prerequisite on
the dependency line which is followed by actual commands".

-- 
Jarmo Jaakkola


Home | Main Index | Thread Index | Old Index