Skip to content

Instantly share code, notes, and snippets.

@aprell
Last active June 16, 2019 17:54
Show Gist options
  • Select an option

  • Save aprell/c5902f24d718f525c13a623e9a56a37c to your computer and use it in GitHub Desktop.

Select an option

Save aprell/c5902f24d718f525c13a623e9a56a37c to your computer and use it in GitHub Desktop.
Target-specific variables
foo: bar
foo:
@echo foo: $(FLAGS)
bar: FLAGS += B
bar: baz
bar:
@echo bar: $(FLAGS)
baz: FLAGS += C
baz:
@echo baz: $(FLAGS)
.PHONY: foo bar baz
@aprell

aprell commented Jun 16, 2019

Copy link
Copy Markdown
Author

make prints:

baz: B C
bar: B
foo:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment