On 08.12.2025 19:54, Grygorii Strashko wrote:
> On 08.12.25 10:35, Jan Beulich wrote:
>> On 05.12.2025 20:34, Grygorii Strashko wrote:
>>> @@ -259,6 +259,7 @@ $(obj)/%.o: $(src)/%.S FORCE
>>>   
>>>   
>>>   quiet_cmd_obj_init_o = INIT_O  $@
>>> +ifneq ($(CONFIG_RELAX_INIT_CHECK),y)
>>>   define cmd_obj_init_o
>>>       $(OBJDUMP) -h $< | while read idx name sz rest; do \
>>>           case "$$name" in \
>>> @@ -271,6 +272,11 @@ define cmd_obj_init_o
>>>       done || exit $$?; \
>>>       $(OBJCOPY) $(foreach s,$(SPECIAL_DATA_SECTIONS),--rename-section 
>>> .$(s)=.init.$(s)) $< $@
>>>   endef
>>> +else
>>> +define cmd_obj_init_o
>>> +    $(OBJCOPY) $(foreach s,$(SPECIAL_DATA_SECTIONS),--rename-section 
>>> .$(s)=.init.$(s)) $< $@
>>> +endef
>>> +endif
>>
>> If the objcopy indeed needs suppressing altogether (as Andrew suggests), the
>> unwanted redundancy here would go away anyway. Otherwise my (recurring)
>> request to avoid such duplication.
> 
> Could you suggest the best way to avoid duplication, please?
> if/else/endif is not working inside "Custom commands" make file commands.
> May be split it on two - cmd_obj_init_check and obj_init_objcopy?

That's one option. Another is to use something like
$(if $(filter y,$(CONFIG_RELAX_INIT_CHECK)), ...).

Jan

Reply via email to