xaelsouth / rtl-wmbus

Software defined receiver for wireless M-Bus with RTL-SDR
222 stars 45 forks source link

Add version number based on git tag and -V to print version number. #23

Closed weetmuts closed 3 years ago

weetmuts commented 3 years ago

The makefile code will use the git history to create a VERSION string and a COMMIT string. The VERSION string looks like:

1.0.1 if you have built a clean clone where the HEAD is tagged with "1.0.1" (you do: "git tag 1.0.1" to tag the current HEAD, then "git push --tags" to push the tags to github.)

1.0.1 with local changes if you have built 1.0.1 with un-committed changes in your repo.

1.0.1-1-gc2897ad if you have built 1.0.1 with one committed change after the tag.

1.0.1-1-gc2897ad with local changes if you have built 1.0.1 with one committed change and you have un-committed changes.

1.0.1-2-gc1138ec if you have built 1.0.1 with two committed changes after the tag.

speed_1.0.1-2-gc1138ec if you have built the development branch speed with two committed changes after the tag.


rtl_wmbus -V will print for example:

rtl_wmbus: speed_1.0.1-2-gc1138ec c1138ece0aebecc9c4304dda958591d9cae4673c