bug-make
[Top][All Lists]
Advanced

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

Re: Adding line numbers to output for "No rule to make target"


From: Jonny Grant
Subject: Re: Adding line numbers to output for "No rule to make target"
Date: Thu, 26 Nov 2015 20:41:08 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0



On 26/11/15 00:04, address@hidden wrote:
Jonny Grant writes:
  >
  >
  > On 25/11/15 13:59, address@hidden wrote:
  > > Jonny Grant writes:
  > >   > Hello
  > >   >
  > >   > Could line numbers be added to output for the case where it says "No
  > >   > rule to make target" please?
  > >   >
  > >   > Example below. GNU Make 4.1
  > >   >
  > >   > I'm not on this list, so please include my email address is any
  > >   > replies Regards, Jonny
  > >
  > >   >
  > >   >
  > >   > makefile.mak
  > >   >
  > >   > %.o : %.d
  > >   >
  > >   > all: test.o
  > >   >     echo processing
  > >   >
  > >   >
  > >   > ^Sorry TAB has been lost by my email client
  > >   >
  > >   > $ make
  > >   > make: *** No rule to make target 'test.o', needed by 'all'.  Stop.
  > >   >
  > >   >
  > >   > Could line number (4) be added to the message?
  > >   >
  > >   > eg
  > >   > $ make
  > >   > make: *** makefile.mak:4 No rule to make target 'test.o', needed by
  > >   > 'all'.  Stop.
  > >
  > >   What should be output if the following is typed?
  > >
  > >     make gungla
  > >
  >
  > Perhaps just the regular because its not got a specific line number:
  >
  > $ make gungla
  > make: *** No rule to make target 'gungla'. Stop.
  >
  >
  > What do think?

  My point was that it's not so simple.

  If you do it that way, now you've got two different formats for the
  same message.  This can be confusing to users, and certainly
  complicates factors if there is software sitting on top of Make and
  operating on the messages (continuous integration / automatic failure
  triage).

CI uses program return codes in my experience.
EXIT_SUCCESS is 0

  Consider the following other special cases:

    o Gnu Make has $(eval), and it's possible to generate rules that
      don't correspond to actual Makefile lines.

I thought the message only related to targets.
Do you mean if targets are generated by $(eval) ?

    o What if there are multiple targets that refer to 'test.o'?
      Should all be reported, or just the one that failed?

Often compilation only reports the first occurrence of the error. Make could behave in a similar way. A more advanced solution would report more.

      (Is the recipe that cannot be built important, or is the use of
      'test.o' important?)

The line number may be useful clue the investigating Make user.
Are the line numbers already available at that point in the code?

Regards, Jonny



reply via email to

[Prev in Thread] Current Thread [Next in Thread]