Copy a bit of code from esp-idf to make better build rules (especially to create a build timestamp only when required.
Authored by: dannybackx 2019-03-05
Parent: [r182]
Child: [r184]