Re: strange dependancy generation bug?

From: Ricky Beam (jfbeam@bluetronic.net)
Date: Tue Jun 03 2003 - 19:43:47 EST


On Tue, 3 Jun 2003, Sam Ravnborg wrote:
>In make a so-called "canned command sequence" is generated.
>Quote from 'info make':
>
> On the other hand, prefix characters on the command line that refers
> to a canned sequence apply to every line in the sequence. So the rule:
>
> frob.out: frob.in
> @$(frobnicate)

(I seriously cannot believe there needs to be a protracted debate about
 what's broken and who's at fault -- make or Makefile. What we see is
 what we get and it's a 5 second fix. Beyond that, it's a problem for
 the GNU Make maintainers, not lkml.)

Weither make is using 1 shell or 10 doesn't matter. Make is the thing
emitting the command to the console as well as feeding the shell. It's
a matter of one command or more than one command.

The Kbuild system is rather complex. If you look deep enough, you'll
see where the '@' is being applied. What is actually happening looks
like this:
        define rule_for_act_of_frobnication
                stuff_that_should_be_one_line
                                \
                but_isn't
        endef

        frobnicate = @set -e; \
                        $(rule_for_act_of_frobnication);

        frob.out: frob.in
                $(call frobnicate)

There's a big difference in @$(call frobnicate) and $(call frobnicate).
Both ultimately resovle to two line of text. In the first case, all of
it hidden. In the second, only the lines explicitly hidden will be hidden.

Make isn't broken. Makefile.build is. To me, this was immediately obvious
and confirmed after a few seconds searching for the "@". (It looks like
someone hit [enter] where they shouldn't have.)

--Ricky

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jun 07 2003 - 22:00:22 EST