Clemens Hintze - 2019-08-02

Hello,

after a long time I have to implement new rules in our Makeppfile where I would have to use $(changed_inputs). But it is daunting me that either the description of $(changed_inputs) is incomplete or my understanding is totally flawed.

Please have a look to this Makeppfile:

SOURCES += a.t b.t c.t

$(foreach).dep : $(foreach) : foreach $(SOURCES)
  : signature md5
  md5sum $(input) > $(output)

summary.dep : $(SOURCES).dep
  : signature md5
  : build_check ignore_action
  md5sum $(changed_inputs) > $(output)

$(phony all) : summary.dep

If I execute ˋmakepp allˋ the first time, all .dep files are built correctly and my ˋsummary.depˋ contains the expected contents: ˋa.t.depˋ, ˋb.t.depˋ and ˋc.t.depˋ with its MD5 sum.

However, if I modify, let's say ˋb.tˋ by executing e.g.: ˋdate > b.tˋ and execute ˋmakepp allˋ again, I would expect the file ˋb.t.depˋ to get updated, and ˋsummary.depˋ would only contain a single entry with ˋb.t.depˋ and its MD5 sum as ˋb.t.depˋ was changed by makepp due to the change of ˋb.tˋ.

However this does not happen: The action that should update ˋsummary.depˋ will hang, as ˋmd5sumˋ will not get any input due to ˋ$(changed_inputs)ˋ being empty :-(

Now I would expect ˋ$(changed_inputs)ˋ to return ˋb.t.depˋ as it is an explicit dependency and it is changed by makepp due to its updated dependency to ˋb.tˋ.

Where is my fault? Do I misunderstand ˋ$(changed_inputs)ˋ?

I get the impression, ˋ$(changed_inputs)ˋ get expanded during compilation of the rule for ˋsummary.depˋ and will check for changed dependencies right at that time. And at that time ˋb.t.depˋ was not updated yet as it will be later on if makepp do its application of out-dated rules to bring all targets up-to-date. But then ˋ$(changed_inputs)ˋ already got its content ...

Can somebody help me here with my understanding and -- perhaps-- provide a work-around how to achieve what I want?

Thanks in advance for any enlightment.

Best Regards,
chi.