Jim Meyering a42324e370 build: do not relink every single binary just for a timestamp
Summary:
Prior to this change, "make check" would always waste a lot of
time relinking 60+ binaries. With this change, it does that
only when the generated file, util/build_version.cc, changes,
and that happens only when the date changes or when the
current git SHA changes.

This change makes some other improvements: before, there was no
rule to build a deleted util/build_version.cc. If it was somehow
removed, any attempt to link a program would fail.
There is no longer any need for the separate file,
build_tools/build_detect_version.  Its functionality is
now in the Makefile.

* Makefile (DEPFILES): Don't filter-out util/build_version.cc.
No need, and besides, removing that dependency was wrong.
(date, git_sha, gen_build_version): New helper variables.
(util/build_version.cc): New rule, to create this file
and update it only if it would contain new information.
* build_tools/build_detect_platform: Remove file.
* db/db_impl.cc: Now, print only date (not the time).
* util/build_version.h (rocksdb_build_compile_time): Remove
declaration.  No longer used.

Test Plan:
- Run "make check" twice, and note that the second time no linking is performed.
- Remove util/build_version.cc and ensure that any "make"
command regenerates it before doing anything else.
- Run this: strings librocksdb.a|grep _build_.
That prints output including the following:

  rocksdb_build_git_date:2015-02-19
  rocksdb_build_git_sha:2.8.fb-1792-g3cb6cc0

Reviewers: ljin, sdong, igor

Reviewed By: igor

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D33591
2015-02-19 13:11:10 -08:00
..
2014-11-21 14:11:40 -08:00
2014-11-07 15:04:30 -08:00
2014-08-19 09:52:54 -04:00
2014-08-19 06:48:21 -07:00
2014-11-14 11:38:26 -08:00
2014-11-14 11:38:26 -08:00
2014-11-20 10:49:32 -08:00
2014-08-28 12:46:05 -04:00
2014-08-28 12:46:05 -04:00
2014-09-21 22:20:00 +08:00
2014-11-14 11:38:26 -08:00
2015-02-18 11:49:31 -08:00
2014-07-25 15:17:06 -07:00
2015-01-23 18:10:52 -08:00
2014-07-28 12:10:49 -07:00
2013-12-03 12:42:15 -08:00
2014-07-28 12:22:37 -07:00
2014-11-21 11:05:28 -05:00
2014-04-17 14:29:28 -07:00
2014-09-08 22:24:40 -07:00
2014-10-31 11:59:54 -07:00
2015-02-18 11:49:31 -08:00
2015-02-18 11:49:31 -08:00
2014-05-01 14:09:32 -04:00
2014-05-01 14:09:32 -04:00