[CRIU] [PATCHv2 1/2] nmk/build: separate msg-* printing from .mk files

Dmitry Safonov dsafonov at virtuozzo.com
Thu Feb 18 01:34:55 PST 2016


On 02/18/2016 12:27 PM, Dmitry Safonov wrote:
> On 02/17/2016 07:16 PM, Dmitry Safonov wrote:
>> Some places in criu need printing support, but do not need
>> common variables redefining, therefore separate msg printing
>> to msg.mk
> Oh, my inattention, Cyrill, please drop it, if you had
> not applied it yet to your tree (will resend v3). Else fixup:
> diff --git a/scripts/nmk/scripts/msg.mk b/scripts/nmk/scripts/msg.mk
> index 255492c..a0279d0 100644
> --- a/scripts/nmk/scripts/msg.mk
> +++ b/scripts/nmk/scripts/msg.mk
> @@ -42,4 +42,9 @@ define msg-build
>          $(E) "  BUILD   " $(1)
>  endef
>
> +#
> +# Footer.
> +$(__nmk_dir)scripts/msg.mk:
> +       @true
> +____nmk_defined__msg = y
>  endif #____nmk_defined__msg
Nothing bad should happen:
just additional redefining the same variables the same way,
but anyway.
>>
>> Acked-by: Cyrill Gorcunov <gorcunov at openvz.org>
>> Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
>> ---
>>   scripts/nmk/scripts/include.mk | 42 
>> ++-------------------------------------
>>   scripts/nmk/scripts/msg.mk     | 45 
>> ++++++++++++++++++++++++++++++++++++++++++
>>   2 files changed, 47 insertions(+), 40 deletions(-)
>>   create mode 100644 scripts/nmk/scripts/msg.mk
>>
>> diff --git a/scripts/nmk/scripts/include.mk 
>> b/scripts/nmk/scripts/include.mk
>> index 6216fea..c7dd7cc 100644
>> --- a/scripts/nmk/scripts/include.mk
>> +++ b/scripts/nmk/scripts/include.mk
>> @@ -1,47 +1,9 @@
>>   ifndef ____nmk_defined__include
>>   -#
>> -# Silent make rules.
>> -ifeq ($(strip $(V)),)
>> -        E := @echo
>> -        Q := @
>> -else
>> -        E := @\#
>> -        Q :=
>> +ifndef ____nmk_defined__msg
>> +        include $(__nmk_dir)msg.mk
>>   endif
>>   -export E Q
>> -
>> -#
>> -# Message helpers.
>> -define msg-gen
>> -        $(E) "  GEN     " $(1)
>> -endef
>> -
>> -define msg-clean
>> -        $(E) "  CLEAN   " $(1)
>> -endef
>> -
>> -define msg-cc
>> -        $(E) "  CC      " $(1)
>> -endef
>> -
>> -define msg-dep
>> -        $(E) "  DEP     " $(1)
>> -endef
>> -
>> -define msg-link
>> -        $(E) "  LINK    " $(1)
>> -endef
>> -
>> -define msg-ar
>> -        $(E) "  AR      " $(1)
>> -endef
>> -
>> -define msg-build
>> -        $(E) "  BUILD   " $(1)
>> -endef
>> -
>>   #
>>   # Common vars.
>>   SUBARCH := $(shell uname -m | sed       \
>> diff --git a/scripts/nmk/scripts/msg.mk b/scripts/nmk/scripts/msg.mk
>> new file mode 100644
>> index 0000000..255492c
>> --- /dev/null
>> +++ b/scripts/nmk/scripts/msg.mk
>> @@ -0,0 +1,45 @@
>> +ifndef ____nmk_defined__msg
>> +
>> +#
>> +# Silent make rules.
>> +ifeq ($(strip $(V)),)
>> +        E := @echo
>> +        Q := @
>> +else
>> +        E := @\#
>> +        Q :=
>> +endif
>> +
>> +export E Q
>> +
>> +#
>> +# Message helpers.
>> +define msg-gen
>> +        $(E) "  GEN     " $(1)
>> +endef
>> +
>> +define msg-clean
>> +        $(E) "  CLEAN   " $(1)
>> +endef
>> +
>> +define msg-cc
>> +        $(E) "  CC      " $(1)
>> +endef
>> +
>> +define msg-dep
>> +        $(E) "  DEP     " $(1)
>> +endef
>> +
>> +define msg-link
>> +        $(E) "  LINK    " $(1)
>> +endef
>> +
>> +define msg-ar
>> +        $(E) "  AR      " $(1)
>> +endef
>> +
>> +define msg-build
>> +        $(E) "  BUILD   " $(1)
>> +endef
>> +
>> +endif #____nmk_defined__msg
>
>


-- 
Regards,
Dmitry Safonov



More information about the CRIU mailing list