Add these lines to the top of a Makefile to load environment variables from a file. The minus sign lets it fail silently if the file doesn't exist:

-include .env
export

The .env file should look like this:

MY_ENV_VAR=1
MY_OTHER_ENV_VAR=2
Previous on Linux
Mastodon Mastodon