[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: |
thutt |
Subject: |
Re: Adding line numbers to output for "No rule to make target" |
Date: |
Wed, 25 Nov 2015 16:04:01 -0800 |
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).
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.
o What if there are multiple targets that refer to 'test.o'?
Should all be reported, or just the one that failed?
(Is the recipe that cannot be built important, or is the use of
'test.o' important?)
--
There's not enough Naugahyde in the world today.