Include Dotenv File to Makefile

sunday-snippet · May 15, 2022 · ~1 min
Sunday Snippet #17 include dotenv file to makefile
Sunday Snippet #17 include dotenv file to makefile

Directory Structure

1
2
3
4
5
6
$ tree -a .
.
├── .env
└── Makefile

0 directories, 2 files

Dotenv File

1
2
$ cat .env
FOO=12345

Makefile

1
2
3
4
5
6
7
$ cat Makefile
include .env

example:
	@echo "${FOO}"
$ make example
12345
· · ·

Love This Content?

Any kind of supports is greatly appreciated! Kindly support me via Bitcoin, Ko-fi, Trakteer, or just continue to read another content. You can write a response via Webmention and let me know the URL via Telegraph.

Drop Your Comment Below