Page MenuHomeFreeBSD

Avoid rebuilding libpmc in every incremental rebuild

Authored by arichardson on May 9 2020, 5:52 PM.



Generate libpmc_events.c in a temporary file first and only overwrite it
if the files are actually different.
This avoids compiling and relinking the different variants of libpmc on
every incremental build.

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

arichardson created this revision.

My only real question is do you want to do a single target? Since you are using mv instead of cp make is always going to invoke both targets anyway. The single target version would just join the two bodies.

40 ↗(On Diff #71592)

Not sure if this should be ${MV} vs mv? (Probably it would in ports, not sure if we add that indirection in src)

jhb added inline comments.
40 ↗(On Diff #71592)

I think you had libpmc_events.c in CLEANFILES in your first version? We probably still want that as well since it's not a checked-in file?

This revision is now accepted and ready to land.Jun 30 2020, 4:51 PM
40 ↗(On Diff #71592)

Ah yes, accidentally dropped that. Will restore before committing.