[CRIU] [PATCH] build/nmk: add per-target LDFLAGS

Dmitry Safonov dsafonov at virtuozzo.com
Sat Feb 20 04:53:32 PST 2016


On 02/20/2016 03:42 PM, Cyrill Gorcunov wrote:
> On Sat, Feb 20, 2016 at 03:34:54PM +0300, Dmitry Safonov wrote:
>>   #
>>   # Accumulate common flags.
>>   define nmk-ccflags
>> -        $(CFLAGS) $(ccflags-y) $(CFLAGS_$@)
>> +        $(CFLAGS) $(ccflags-y) $($@-ccflags-y)
>>   endef
> say
>
> obj-y += somefile.o
> CFLAGS_somefile.o += -Wall
>
> this is more natural than
>
> somefile.o-ccflags-y += Wall
>
> no?
Hehe, you win here, but we'll still have
somefile.o-ldflags-y += -lm

So, I was looking from a point of variable like:
target-a := a.built-in.o

$(target-a)-obj-y += a.o b.o
$(target-a)-ldflags-y += -lm
CFLAGS_$(target-a) += -DCONFIG_A_ENABLED
ASFLAGS_$(target-a) += -iquote $(obj)/include

# ....
ifeq (,)
target += $(target-a)
endif
>
>>   define nmk-asflags
>> -        $(CFLAGS) $(ASFLAGS) $(asflags-y) $(ASFLAGS_$@)
>> +        $(CFLAGS) $(ASFLAGS) $(asflags-y) $($@-asflags-y)
>>   endef
>>
>> -- 
>> Regards,
>> Dmitry Safonov
>>
> 	Cyrill


-- 
Regards,
Dmitry Safonov



More information about the CRIU mailing list