aboutsummaryrefslogtreecommitdiffhomepage
path: root/GNUmakefile
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2020-01-13 14:26:10 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2020-01-13 14:26:10 +0100
commit49eb5405debb49d19c58f966b4fceac9ea9571ae (patch)
tree06e1fda08307b0838ea3fdbc5e0278a9f321a448 /GNUmakefile
parent68fd40e4fce33b19f946f54388a4016ab32998e0 (diff)
downloadwallabag-49eb5405debb49d19c58f966b4fceac9ea9571ae.tar.gz
wallabag-49eb5405debb49d19c58f966b4fceac9ea9571ae.tar.zst
wallabag-49eb5405debb49d19c58f966b4fceac9ea9571ae.zip
Ensure ENV is well defined when using make
This command should fail before calling other commands (which will fail to because the environment is wrong): ``` ENV=toto make install ```
Diffstat (limited to 'GNUmakefile')
-rwxr-xr-xGNUmakefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 865b35e8..db87c5d2 100755
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -2,7 +2,17 @@ SHELL=bash
2TMP_FOLDER=/tmp 2TMP_FOLDER=/tmp
3RELEASE_FOLDER=wllbg-release 3RELEASE_FOLDER=wllbg-release
4 4
5ENV ?= prod 5# ensure the ENV variable is well defined
6ifeq ($(origin ENV), prod)
7 # all good ("prod" is a valid env)
8else ifeq ($(origin ENV), dev)
9 # all good ("dev" is a valid env)
10else ifeq ($(origin ENV), test)
11 # all good ("test" is a valid env)
12else
13 # not good, force it to "prod"
14 override ENV = prod
15endif
6 16
7help: ## Display this help menu 17help: ## Display this help menu
8 @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 18 @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'