Hi Nazir,
Thank you for pointing this out, and thanks to Andres for the clarification in the referenced thread.
You are absolutely right — with a stamp file, we need to ensure that its timestamp is updated unconditionally so that it remains newer than the inputs. Keeping the existence check (if (! -f ...)) would indeed leave the stamp file older than the rebuilt library, which can trigger unnecessary rebuilds in Makefile-based builds.
Although Ninja avoids repeated rebuilds due to its internal tracking, Make relies purely on timestamps, so the safer and correct behavior is to always recreate (touch) the stamp file.
The updated implementation without the existence check is therefore the correct approach.
Regards,
Vasuki M
C-DAC,chennai