Skip to content

Instantly share code, notes, and snippets.

@jgermade
Created February 26, 2021 15:40
Show Gist options
  • Save jgermade/8c2d42126ce2369edda0864ee3470d62 to your computer and use it in GitHub Desktop.
Save jgermade/8c2d42126ce2369edda0864ee3470d62 to your computer and use it in GitHub Desktop.
override and aliasing environment variables in Makefile
# API=staging if not defined
ifndef API
export API=staging
endif
# API=dev as an alias for API=development
ifeq ($(API),dev)
override API=development
export API
endif
# API=prod as an alias for API=production
ifeq ($(API),prod)
override API=production
export API
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment