build: Add git ref to the binary
In order to be able to figure out which binary is in use (for example
in debugging situation) it's really helpful to have the 'git describe'
ref added to the binary.
The simplest way to expose the it via good old Source Code Control
System string id. No need to come up with something complicated else
as there is no agreement on how to do this. So let's add this simple
magic string to library.
You can either query with 'what' or just
$strings .build/src/libnvme.so | grep '@(#)'
@(#)libnvme
1.0-1-g5ff5d22+
The idea how to extract the version string is shamelessly copied from
the systemd project.
Signed-off-by: Daniel Wagner <dwagner@suse.de>