Skip to content

Instantly share code, notes, and snippets.

@AndreaRigoni
Last active September 12, 2018 12:24
Show Gist options
  • Save AndreaRigoni/87d4186075b781259244175a24f00594 to your computer and use it in GitHub Desktop.
Save AndreaRigoni/87d4186075b781259244175a24f00594 to your computer and use it in GitHub Desktop.
include a local variable for each target
AC_VARIABLES = MYVAR
$(foreach v,$(AC_VARIABLES),$(eval %: $v := $$($v) $$(ac__$v) ))
ac__MYVAR = two
ac__MYVAR += three
inlcude common.mk
MYVAR = one
print:
@ echo $(MYVAR)
## this should return: one two three
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment