Page MenuHomeFreeBSD

Avoid rebuilding libpmc in every incremental rebuild
ClosedPublic

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

Details

Summary

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

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

arichardson requested review of this revision.May 9 2020, 5:52 PM
arichardson created this revision.
jhb added a comment.Jun 23 2020, 4:53 PM

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.

lib/libpmc/Makefile
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)

use a single make target

jhb accepted this revision.Jun 30 2020, 4:51 PM
jhb added inline comments.
lib/libpmc/Makefile
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
arichardson added inline comments.Jun 30 2020, 6:47 PM
lib/libpmc/Makefile
40 ↗(On Diff #71592)

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

This revision was automatically updated to reflect the committed changes.