From 2ea8114378de78a682ee5f7f671e04bc4d7b17ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Fri, 14 Sep 2018 10:51:40 +0200 Subject: [PATCH] Formatting and guarding --- Makefile | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 40e223b..fd3edaf 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ -# *.conf file handling +######### +# CONFIGS + CONF_WILDC:=$(wildcard $(PWD)/*.conf) CONF_SOURCE:=$(patsubst %,. %;,$(CONF_WILDC)) @@ -17,15 +19,31 @@ ifeq ($(CONF_TARGETROOT),) $(error TARGETROOT not set in $(CONF_WILDC)) endif +# suffix for project directories +PROJ_SUFFX:=$(call confvalue,SUFFIX_PROJECT) +ifeq ($(PROJ_SUFFX),) +$(error SUFFIX_PROJECT not set in $(CONF_WILDC)) +endif + +# suffix for disabled project directories +DOWN_SUFFX:=$(call confvalue,SUFFIX_DOWN) +ifeq ($(SUFFIX_DOWN),) +$(error SUFFIX_DOWN not set in $(CONF_WILDC)) +endif + +######### +# CONSTANTS + # file to store docker network cidr FILE_DOCKERNET:=$(CONF_TARGETROOT)/up-$(CONF_DOCKERNET) # project directory handling -PROJ_SUFFX:=$(call confvalue,SUFFIX_PROJECT) -DOWN_SUFFX:=$(call confvalue,SUFFIX_DOWN) PROJ_WILDC:=$(wildcard *$(PROJ_SUFFX)) PROJ_NAMES:=$(basename $(PROJ_WILDC)) +######### +# FUNCTIONS + # different complexities of commands with root privileges # - in project directory projsudo=cd "$<"; sudo bash -c "$(1)" @@ -142,7 +160,7 @@ s?=bash # default compose file define COMPOSEFILE -version: '2' +version: "3" networks: default: