[CRIU] [PATCH 4/9] nmk: build.mk -- Make process depend on Makefile itself

Dmitry Safonov dsafonov at virtuozzo.com
Wed Mar 23 04:53:52 PDT 2016


On 03/23/2016 02:50 PM, Dmitry Safonov wrote:
> On 03/23/2016 02:43 PM, Pavel Emelyanov wrote:
>>> @@ -46,6 +47,16 @@ builtin-name    := $(strip $(builtin-name))
>>>   ld_flags    := $(strip $(LDFLAGS) $(ldflags-y))
>>>     #
>>> +# $(obj) related rules.
>>> +$(eval $(call 
>>> gen-rule-o-from-c-by-name,$(obj)/%,$(obj)/%,$(src-makefile)))
>>> +$(eval $(call 
>>> gen-rule-i-from-c-by-name,$(obj)/%,$(obj)/%,$(src-makefile)))
>>> +$(eval $(call 
>>> gen-rule-s-from-c-by-name,$(obj)/%,$(obj)/%,$(src-makefile)))
>>> +$(eval $(call 
>>> gen-rule-o-from-S-by-name,$(obj)/%,$(obj)/%,$(src-makefile)))
>>> +$(eval $(call 
>>> gen-rule-d-from-c-by-name,$(obj)/%,$(obj)/%,$(src-makefile)))
>>> +$(eval $(call 
>>> gen-rule-d-from-S-by-name,$(obj)/%,$(obj)/%,$(src-makefile)))
>>> +$(eval $(call 
>>> gen-rule-i-from-S-by-name,$(obj)/%,$(obj)/%,$(src-makefile)))
>> Please enlighten me. We're making o-from-c, i-from-c, s-from-c, 
>> blah-blah-blah
>> for a makeifle?
> No, it's here as a dependency: the first patch in this set adds
> the third parameter to each of gen-rules:
> >+$(1).o: $(2).c $(3)
> so that each generated o/i/s/d file will depend on this parameter 
> (makefile).
> Which will lead to recompilation of object files in a directory, where
> makefile has changed.
For the correctness - not in a directory, but for files, which
implicit rules had expanded in makefile that just has changed.
>>
>>> +
>>> +#
>>>   # Prepare targets.
>>>   ifneq ($(lib-y),)
>>>           lib-target :=
>
>


-- 
Regards,
Dmitry Safonov



More information about the CRIU mailing list