[CRIU] [PATCH 1/2] build/nmk: define map and newline

Dmitry Safonov dsafonov at virtuozzo.com
Fri Feb 19 06:17:25 PST 2016


On 02/19/2016 05:03 PM, Cyrill Gorcunov wrote:
> On Fri, Feb 19, 2016 at 04:02:50PM +0300, Dmitry Safonov wrote:
>> map is very good at generating rules.
>> Just map gen function to array of it's parameters.
>> Don't forget to eval the result.
>>
>> I'll use it in feature-tests generation and in someday coming
>> compat 32-bit mode - in x86 makefiles.
>>
>> Cc: Cyrill Gorcunov <gorcunov at openvz.org>
>> Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
>> ---
>>   scripts/nmk/scripts/msg.mk | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/scripts/nmk/scripts/msg.mk b/scripts/nmk/scripts/msg.mk
>> index a0279d0..88cc774 100644
>> --- a/scripts/nmk/scripts/msg.mk
>> +++ b/scripts/nmk/scripts/msg.mk
>> @@ -42,6 +42,17 @@ define msg-build
>>           $(E) "  BUILD   " $(1)
>>   endef
>>   
>> +define \n
>> +
>> +
>> +endef
> Escaped symbols are definitely a way to get some problems :)
> Just call it "newline"
Ok, I will resend
>
> define newline
>
>
> endef
>
> map = $(foreach x,$2,$(call $1,$x)$(newline))
>
> (I really tempting to call it well known mapcar,
>   but this won't work :)
Hehe, I may change this also if you want to :)

-- 
Regards,
Dmitry Safonov



More information about the CRIU mailing list