[sr-dev] git:master: makefile: quiet output support

Daniel-Constantin Mierla miconda at gmail.com
Thu Mar 18 15:28:23 CET 2010



On 03/18/2010 03:20 PM, Andrei Pelinescu-Onciul wrote:
> On Oct 10, 2009 at 22:01, Jan Janak<jan at ryngle.com>  wrote:
>    
>> I like this, how about making the quiet mode default?
>>      
> I've started to like it too :-)
>
> Anybody disagrees with making the quiet mode the default (you would need
>   to make cfg Q=0 or make Q=0 ... to see the gcc comandline)?
> If nobody says anything in the next 7 days, I'll change it.
>    

It is ok for me, just a note about debian packaging. I remember I wanted 
to make it default in kamailio when I was taking care of deb packaging 
and guys from debian opposed because, iirc, their building systems keep 
and need all compilation flags and logs. Anyhow I guess this can be 
fixed in deb control files.

On another hand, would be possible to have Q=2 something like print all 
compile flags once (only for core, modules/libs may have extra) at 
beginning and then act as Q=1?

Cheers,
Daniel


> Andrei
>
>    
>> On Fri, Oct 9, 2009 at 4:48 PM, Andrei Pelinescu-Onciul
>> <andrei at iptel.org>  wrote:
>>      
>>> Module: sip-router
>>> Branch: master
>>> Commit: e37e8d6a6158d49aa5fa1092d91b595cf0d91e2d
>>> URL: ?? ??http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e37e8d6a6158d49aa5fa1092d91b595cf0d91e2d
>>>
>>> Author: Andrei Pelinescu-Onciul<andrei at iptel.org>
>>> Committer: Andrei Pelinescu-Onciul<andrei at iptel.org>
>>> Date: ?? Fri Oct ??9 15:30:02 2009 +0200
>>>
>>> makefile: quiet output support
>>>
>>> Support for quiet output (without all the flags and compile
>>> options): make Q=1 or make QUIET=1.
>>> It can be saved in the config (e.g. make config Q=1) and it can be
>>> overridden any time (e.g. make utils Q=0).
>>> Compilation is a little faster in quiet mode and the same speed as
>>> before in normal mode.
>>>
>>> Example module output:
>>> CC (gcc) [M tm.so] ?? ?? ?? ?? ?? ?? ??uac.o
>>> LD (gcc) [M tm.so] ?? ?? ?? ?? ?? ?? ??tm.so
>>>
>>> Lib example:
>>> LD (gcc) [L libbinrpc.so.0.1] ?? ?? ?? ?? ?? libbinrpc.so.0.1
>>>
>>> ---
>>>
>>> ??Makefile.defs ??| ?? ??3 ++-
>>> ??Makefile.rules | ?? 28 ++++++++++++++++++++++++++--
>>> ??2 files changed, 28 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/Makefile.defs b/Makefile.defs
>>> index f883a0b..a9bd307 100644
>>> --- a/Makefile.defs
>>> +++ b/Makefile.defs
>>> @@ -1901,7 +1901,8 @@ saved_fixed_vars:= ?? ?? ?? ??MAIN_NAME ??CFG_NAME SCR_NAME \
>>> ?? ?? ?? ?? ?? ?? ?? ??PREFIX LOCALBASE \
>>> ?? ?? ?? ?? ?? ?? ?? ??TAR \
>>> ?? ?? ?? ?? ?? ?? ?? ??INSTALL INSTALL_CFG INSTALL_BIN INSTALL_MODULES INSTALL_DOC \
>>> - ?? ?? ?? ?? ?? ?? ?? INSTALL_MAN INSTALL_LIB INSTALL_TOUCH INSTALL_SHARE
>>> + ?? ?? ?? ?? ?? ?? ?? INSTALL_MAN INSTALL_LIB INSTALL_TOUCH INSTALL_SHARE \
>>> + ?? ?? ?? ?? ?? ?? ?? Q
>>>
>>> ??# variable changeable at compile time
>>> ??# extra: prefix DESTDIR BASEDIR basedirt
>>> diff --git a/Makefile.rules b/Makefile.rules
>>> index 99042c3..55c7897 100644
>>> --- a/Makefile.rules
>>> +++ b/Makefile.rules
>>> @@ -52,9 +52,33 @@ endif
>>>
>>> ??ALLDEP+=makecfg.lst
>>>
>>> +# returns current type: "" core/unknown, "M" module, "L" libray, "U" util
>>> +crt_type=$(if $(MOD_NAME),M,$(if $(LIB_NAME),L,$(if $(UTIL_NAME),U)))
>>> +
>>> +cmd_CC=$(CC) $(CFLAGS) $(C_INCLUDES) $(INCLUDES) $(C_DEFS) $(DEFS) -c $<  -o $@
>>> +cmd_LD=$(LD) $(LDFLAGS) $(objs) $(extra_objs) $(ALL_LIBS) $(SER_RPATH) \
>>> + ?? ?? ?? -o $(NAME)
>>> +
>>> +# what will be displayed if quiet==silent
>>> +silent_cmd_CC=CC ($(CC)) [$(strip $(crt_type) $(NAME))] ?? ?? ?? ?? ?? ?? ?? ??$@
>>> +silent_cmd_LD=LD ($(LD)) [$(strip $(crt_type) $(NAME))] ?? ?? ?? ?? ?? ?? ?? ??$@
>>> +
>>> +ifneq (,$(filter 1 yes on, $(Q) $(QUIET)))
>>> +quiet=silent
>>> +Q=1
>>> +else
>>> +Q=0
>>> +quiet=verbose
>>> +endif
>>> +
>>> +quote:= "
>>> +escall= $(subst $$,$$$$,$(subst $(quote),\$(quote),$1))
>>> +exec_cmd= $(if $($(quiet)_cmd_$(1)),\
>>> + ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? @echo "$(call escall,$($(quiet)_cmd_$(1)))" ;) $(cmd_$(1))
>>> +
>>> ??#implicit rules
>>> ??%.o:%.c ??$(ALLDEP)
>>> - ?? ?? ?? $(CC) $(CFLAGS) $(C_INCLUDES) $(INCLUDES) $(C_DEFS) $(DEFS) -c $<  -o $@
>>> + ?? ?? ?? $(call exec_cmd,CC)
>>>
>>> ??%.d: %.c $(ALLDEP)
>>> ?? ?? ?? ??@set -e; $(MKDEP) $(CFLAGS) $(C_INCLUDES) $(INCLUDES) $(C_DEFS) $(DEFS) $<\
>>> @@ -149,7 +173,7 @@ endif
>>>
>>> ??# normal rules
>>> ??$(NAME): $(objs) $(ALLDEP)
>>> - ?? ?? ?? $(LD) $(LDFLAGS) $(objs) $(extra_objs) $(ALL_LIBS) $(SER_RPATH) -o $(NAME)
>>> + ?? ?? ?? $(call exec_cmd,LD)
>>>
>>>
>>> ??librpath.lst: $(ALLDEP)
>>>
>>>
>>> _______________________________________________
>>> sr-dev mailing list
>>> sr-dev at lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>>>
>>>        
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>
>    

-- 
Daniel-Constantin Mierla
* http://www.asipto.com/




More information about the sr-dev mailing list