Passing variables, exported variables, or
.env (dot env) file variables from outside of a Makefile can be completed in a few ways.
Pass variables to Makefile using environment variables
Exported environment variables are referenced by name in the Makefile:
Pass variables to Makefile using command line
Similarly, variables may be explicitly passed to
make prior to command executions.
Pass variables using
.env (dot env) files
Makefiles can contain an
include directive which reads one or more files before executing.
ifneq (,$(wildcard ./.env))