Skip to content

Instantly share code, notes, and snippets.

@MarcusJohnson91
Last active April 5, 2017 02:11
Show Gist options
  • Save MarcusJohnson91/7b4bc9985a885a030f9d66d6885f3d3d to your computer and use it in GitHub Desktop.
Save MarcusJohnson91/7b4bc9985a885a030f9d66d6885f3d3d to your computer and use it in GitHub Desktop.
Gets the version number from a header and publishes it as VERSION in Make
VERSION := $(shell grep @version $(FILE_TO_GET_VERSION_NUMBER_FROM) | echo | grep -o '[0-9]\.[0-9]\.[0-9]')
# `@version` is a doxygen comment identifier in the header to get the version number from btw, it extracts the whole string, then the last grep command extracts just the number from it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment