[FFmpeg-devel] [PATCH v2] Beautify build output making it easier to see compiler warnings

Måns Rullgård mans
Fri Mar 5 15:59:59 CET 2010


Georgi Chorbadzhiyski <gf at unixsol.org> writes:

> Around 03/05/10 12:14, Stefano Sabatini scribbled:
>> On date Friday 2010-03-05 10:59:41 +0200, Georgi Chorbadzhiyski encoded:
>>> Around 03/04/10 16:37, Luca Barbato scribbled:
>>>> On 03/03/2010 05:57 PM, Georgi Chorbadzhiyski wrote:
>>>>> With this patch the build output will look similar to Linux Kernel kbuild and git.
>>>>> Something like this:
>>>>>
>>>>>   CC         libavdevice/alldevices.c
>>>>> libavdevice/alldevices.c:32: warning: no previous prototype for 'avdevice_register_all'
>>>>>   CC         libavdevice/avdevice.c
>>>>>   CC         libavdevice/alsa-audio-common.c
>>>>>
>>>>> This makes it very easy to see compiler warnings for example. If you want
>>>>> to see the whole command that make executes you may use
>>>>>
>>>>> make Q=
>>>>
>>>> Usually you call it with V=1, beside that I did something like that long
>>>> ago, yours seems less invasive since doesn't cover the install target.
>>>
>>> Of course it should be with V=1, my bad. Attached version 2 of the patch now
>>> with added support for install and uninstall targets, also make V=1 should be
>>> used to see the executed command or exported BUILD_OUPUT=1.
>>>
>>> make clean and distclean are not covered in the moment. I can easily add them
>>> but I don't think their output will improve.
>>>
>>> diffstat pretty-build-output_v2.diff
>>>  Makefile   |   67 ++++++++++++++++++++++++++++++++-------------------
>>>  common.mak |   37 +++++++++++++++++++++++-----
>>>  subdir.mak |   79 ++++++++++++++++++++++++++++++++++++-------------------------
>>>  3 files changed, 119 insertions(+), 64 deletions(-)
>> 
>> Consider this approach:
>> http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/95102
>> 
>> which should issue a smaller change.
>
> Is this better:
>
> -   $(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS)
> +   $(call build_cmd,LD,$<, $(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS) )
>
> Than this:
>
> +   @echo "  CC         $<"
>     $(CCDEP)
> -   $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
> +   $(Q)$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
>
> Sure the first one is less lines changed but in the long term when somebody
> tries to read this $(call build_cmd) it is not going to be pleasant :)
>
> Also the minimal attached patch (based on the mail you point me to) do not
> handle many of the build targets. When install, uninstall, strip, docs, tests,
> etc. are added there will be similar number of lines + the ugliness in
> every command. Also the "eval" approach in theory will slow down the build.

I have some ideas, but I don't have time to look into it right at this
moment.  Since there's apparently interest, I'll try to find the time
over the next few days.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list