Skip to content

Instantly share code, notes, and snippets.

@aprxi
Last active September 26, 2019 14:23
Show Gist options
  • Save aprxi/fa96407524e771595c5c093d361ad411 to your computer and use it in GitHub Desktop.
Save aprxi/fa96407524e771595c5c093d361ad411 to your computer and use it in GitHub Desktop.
Makefile-readvar
# Retrieve a variable from a file in to Makefile
# Strips off any quotes as well, \47 represents a strong-quote
MODULE_NAME = \
$(shell awk -F= '/^NAME\ ?=/{gsub(/\47|"/, "", $$NF);print $$NF;exit}' variables)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment