DEV Community

Clavin June
Clavin June

Posted on • Originally published at clavinjune.dev on

Include Dotenv File to Makefile

Sunday Snippet #17 include dotenv file to makefile

Directory Structure

$ tree -a .
.
├── .env
└── Makefile

0 directories, 2 files
Enter fullscreen mode Exit fullscreen mode

Dotenv File

$ cat .env
FOO=12345
Enter fullscreen mode Exit fullscreen mode

Makefile

$ cat Makefile
include .env

example:
    @echo "${FOO}"
$ make example
12345
Enter fullscreen mode Exit fullscreen mode

Top comments (0)