From 66f88294a69a87179279d46ad50b767ba9903b0c Mon Sep 17 00:00:00 2001 From: EliChin Date: Thu, 29 Apr 2021 17:34:23 +0300 Subject: [PATCH] Add env target in Makefile Signed-off-by: EliChin --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Makefile b/Makefile index c8d2fc5..9e55281 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,12 @@ STOP_SVCS = $(shell tac .services | grep -v \\\#) # List of hosts available in devenv HOSTS_LINES = $(shell grep -Rl IPV4_PREFIX ./services/* | grep .hosts) +# Paths to protocol.privnet.yml +MORPH_CHAIN_PROTOCOL = './services/morph_chain/protocol.privnet.yml' +CHAIN_PROTOCOL = './services/chain/protocol.privnet.yml' + +# List of grepped environment variables from *.env +GREP_DOTENV = $(shell find . -name '*.env' -exec grep -rhv -e '^\#' -e '^$$' {} + ) # Pull all required Docker images .PHONY: pull @@ -86,3 +92,10 @@ clean: done fi done + +# Generate environment +.PHONY: env +env: + @$(foreach envvar,$(GREP_DOTENV),echo $(envvar);) + @echo MORPH_BLOCK_TIME=$(shell grep 'SecondsPerBlock' $(MORPH_CHAIN_PROTOCOL) | awk '{print $$2}')s + @echo MAINNET_BLOCK_TIME=$(shell grep 'SecondsPerBlock' $(CHAIN_PROTOCOL) | awk '{print $$2}')s