-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
481 lines (385 loc) · 16 KB
/
Makefile
File metadata and controls
481 lines (385 loc) · 16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
# ifeq ($(origin .RECIPEPREFIX), undefined)
# $(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
# endif
# .RECIPEPREFIX = >
# INITIAL VARS
CURRENT_MAKEFILE := $(lastword $(MAKEFILE_LIST))
_MKFILE_PATH = $(shell readlink $(CURRENT_MAKEFILE) || ls -1 $(CURRENT_MAKEFILE))
_MKFILE_REALPATH = $(abspath $(lastword $(_MKFILE_PATH)))
_MKFILE_REALPATH_DIR = $(dir $(abspath $(lastword $(_MKFILE_PATH))) )
.DEFAULT_GOAL := help
_ENVMAKE_FILE_EXIST = 0
EARLYEXIT ?= 1
## CHECK SHELL SETUP
_MAKEFILE_KNOWN_SHELL := /bin/sh /bin/bash /usr/bin/tcsh /bin/zsh /home/linuxbrew/.linuxbrew/bin/nu
_MAKEFILE_DEFSHELL := $(SHELL)
#SHELL =
#SHELLFLAGS :=
_MAKEFILE_KNOWN_SHELL_NAME := $(strip $(foreach a,$(_MAKEFILE_KNOWN_SHELL),$(call notdir,$a)))
ifneq ("$(wildcard $(USESHELL))","")
ifneq ($(filter $(call notdir, $(USESHELL)),$(_MAKEFILE_KNOWN_SHELL_NAME)),)
# $(info Current shell is: $(USESHELL) )
SHELL = $(USESHELL)
else
$(info Unknown shell: $(USESHELL); Use default: $(SHELL))
endif
endif
## _TARGET_ENDPOINT_RAW_POSTFIX := Raw
_TARGET_ENDPOINT_UNKNOWN := unknown
##
_MK_DIR_THIS_MAKEFILE := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
#?_MK_IS_CTX_SRV_EXIST = 9
_ENVMAKEFILEPATH := $(call addprefix, $(_MKFILE_REALPATH_DIR), .envmake)
## INCLUSE BASE ENV-file `.envmake` OR SET DEFAULT
_INCPATH = $(_MKFILE_REALPATH_DIR)
ifneq (,$(wildcard $(_ENVMAKEFILEPATH)))
_ENVMAKE_FILE_EXIST = 1
#ifeq ($(shell test -L $(CURRENT_MAKEFILE) && echo -n yes || echo -n no),no)
include $(_ENVMAKEFILEPATH)
#.envmake
#else
# include .envmake
#endif
else
_ENVMAKE_FILE_EXIST = 0
_SRV_AFFIX ?= .yml
_VOL_AFFIX ?= .yml
_ENV_AFFIX ?= .env
_MK_DIR_MKFILE ?= .mkfile/
_MK_DIR_TEST ?= .test/
_MK_DIR_TEMPLATE ?= .template/
_MK_DIR_CONTEXT ?= .context/
_MK_DIR_KVDB ?= .kvdb/
_MK_DIR_DOCKER_COMPOSE ?= docker.compose/
_MK_DIR_DOCKER_COMPOSE_ENV ?= docker.compose.env/
_MK_DIR_YML_SERVICES ?= services/
_MK_DIR_YML_VOLUMES ?= volumes/
_MK_DIR_TARGET_CTX_TMPL ?= .tmpl/
_MK_DIR_TARGET_CTX_YML ?= .yml/
_MK_DIR_TARGET_CTX_ENV ?= .env/
_MK_DC_TMPL_HEAD ?= dc.head.tmpl
_MK_DC_TMPL_NETWORK ?= dc.network.tmpl
_MK_DC_TMPL_SERVICES ?= dc.services.tmpl
_MK_DC_TMPL_TAIL ?= dc.tail.tmpl
_MK_DC_TMPL_MAIN ?= dc.tmpl
_MK_DC_TMPL_VOLUMES ?= dc.volumes.tmpl
_MK_DC_TMPL_DEFAULT_ENV ?= .default.env
_MK_DC_DEFAULT_ENV ?= default.env
_MK_FN_DC_DEFAULT_YML ?= docker-compose.yml
_MK_FN_DC_DEFAULT_ENV ?= .env
_MK_FN_DEFAULT_KVDB ?= kv.db.txt
_MK_FN_HELP_KVDB ?= kv.help.db.txt
_MK_DIR_TEMPLATE_DOCKER_COMPOSE = $(_MK_DIR_TEMPLATE)$(_MK_DIR_DOCKER_COMPOSE)
_MK_DIR_TEMPLATE_DOCKER_COMPOSE_ENV = $(_MK_DIR_TEMPLATE)$(_MK_DIR_DOCKER_COMPOSE_ENV)
_MK_DIR_TEMPLATE_DOCKER_COMPOSE_YML_SERVICES = $(_MK_DIR_TEMPLATE_DOCKER_COMPOSE)$(_MK_DIR_YML_SERVICES)
_MK_DIR_TEMPLATE_DOCKER_COMPOSE_YML_VOLUMES = $(_MK_DIR_TEMPLATE_DOCKER_COMPOSE)$(_MK_DIR_YML_VOLUMES)
_MK_DIR_TEMPLATE_DOCKER_COMPOSE_YML_TEMPLATE = $(_MK_DIR_TEMPLATE_DOCKER_COMPOSE)$(_MK_DIR_TEMPLATE)
endif
_MK_DIR_PATH_MKFILE = $(realpath $(_MK_DIR_MKFILE))
_MK_DIR_PATH_TEST = $(realpath $(_MK_DIR_TEST))
_MK_DIR_PATH_TEMPLATE ?= $(realpath $(_MK_DIR_TEMPLATE))
_MK_DIR_PATH_CONTEXT ?= $(realpath $(_MK_DIR_CONTEXT))
_MK_DIR_PATH_DOCKER_COMPOSE = $(realpath $(_MK_DIR_DOCKER_COMPOSE))
_MK_DIR_PATH_DOCKER_COMPOSE_ENV ?= $(realpath $(_MK_DIR_DOCKER_COMPOSE_ENV))
_MK_DIR_PATH_YML_SERVICES ?= $(realpath $(_MK_DIR_YML_SERVICES))
_MK_DIR_PATH_YML_VOLUMES ?= $(realpath $(_MK_DIR_YML_VOLUMES))
_MK_DIR_PATH_TEMPLATE_DOCKER_COMPOSE = $(realpath $(_MK_DIR_TEMPLATE_DOCKER_COMPOSE))
_MK_DIR_PATH_TEMPLATE_DOCKER_COMPOSE_ENV = $(realpath $(_MK_DIR_TEMPLATE_DOCKER_COMPOSE_ENV))
_MK_DIR_PATH_TEMPLATE_DOCKER_COMPOSE_YML_SERVICES = $(realpath $(_MK_DIR_TEMPLATE_DOCKER_COMPOSE_YML_SERVICES))
_MK_DIR_PATH_TEMPLATE_DOCKER_COMPOSE_YML_VOLUMES = $(realpath $(_MK_DIR_TEMPLATE_DOCKER_COMPOSE_YML_VOLUMES))
_MK_DIR_PATH_TEMPLATE_DOCKER_COMPOSE_YML_TEMPLATE = $(realpath $(_MK_DIR_TEMPLATE_DOCKER_COMPOSE_YML_TEMPLATE))
## KEYMAP
_MK_FN_PATH_RELATIVE_KVDB ?= $(call addprefix, $(_MK_DIR_KVDB), $(_MK_FN_DEFAULT_KVDB))
_MK_FN_PATH_KVDB ?= $(realpath $(_MK_FN_PATH_RELATIVE_KVDB))
# _MK_KEYMAP_FILES ?= $(_MK_FN_PATH_KVDB)
# include $(call addprefix, $(_MK_DIR_MKFILE), keymap.mk)
## B: INCLUDE LIBRARY mk-files
_MK_FILE_NAME_INCLUDE_LIST := const.mk io.console.mk condition.mk context.mk service.mk help.mk
# include $(_MK_FILE_FULLNAME_INCLUDE_LIST)
ifeq ($(shell test -L $(CURRENT_MAKEFILE) && echo -n yes || echo -n no),no)
_MK_FILE_FULLNAME_INCLUDE_LIST := $(strip $(foreach m, $(_MK_FILE_NAME_INCLUDE_LIST), $(call addprefix, $(_MK_DIR_MKFILE), $m)))
include $(_MK_FILE_FULLNAME_INCLUDE_LIST)
else
_MKFILE_LINK := 1
# _MKFILE_PATH = $(shell readlink $(CURRENT_MAKEFILE))
# _MKFILE_REALPATH = $(abspath $(lastword $(_MKFILE_PATH)))
# _MKFILE_REALPATH_DIR = $(dir $(abspath $(lastword $(_MKFILE_PATH))) )
# ?_MKFILE_REALPATH_DIR_MKFILE := $(call addprefix, $(_MKFILE_REALPATH_DIR), $(_MK_DIR_MKFILE))
# ?_MK_FILE_FULLNAME_INCLUDE_LIST := $(strip $(foreach m, $(_MK_FILE_NAME_INCLUDE_LIST), $(call addprefix, $(_MKFILE_REALPATH_DIR_MKFILE), $m)))
_MK_FILE_FULLNAME_INCLUDE_LIST := $(strip $(foreach m, $(_MK_FILE_NAME_INCLUDE_LIST), $(call addprefix, $(_MK_DIR_MKFILE), $m)))
include $(_MK_FILE_FULLNAME_INCLUDE_LIST)
endif
## E: INCLUDE LIBRARY mk-files
# _FILE_OF_MARK_CTX := $(call addprefix, $(_MKFILE_REALPATH_DIR), $(_MK_FN_DC_DEFAULT_ENV))
# CTX_CURRENT := $(notdir $(patsubst %/,%,$(dir $(shell echo -n "`readlink $(_FILE_OF_MARK_CTX)`"))))
## INCLUDE CONFIG IF EXISTS - this file leaves the ability to redefine variables without editing the main files
ifneq ($(wildcard $(call addprefix, $(_MK_DIR_MKFILE), config.mk)),)
include $(call addprefix, $(_MK_DIR_MKFILE), config.mk)
endif
## make -s $(1) CTX=$(CTX_CURRENT);
## make -s $(1);
# define __set_target_name
# printf "$(1)"
# endef
##
## __try_context_overwrite
## build new `make` command using first parameter
## as name of new target (callback)
define __try_context_overwrite
$(eval ifeq (,$(1))
$(eval _TARGET_NAME_REDIRECT_RAW = $(addprefix $@, $(_TARGET_ENDPOINT_UNKNOWN)))
else
$(eval _TARGET_NAME_REDIRECT_RAW = $(1))
endif)
$(eval NEW_COMMAND_VARIABLES = $(shell echo -n $(-*-command-variables-*-) | sed 's/\(CTX\=[^\ ]*\)//') )
$(eval _TARGET_NAME_RAW = $(_TARGET_NAME_REDIRECT_RAW))
@if [ "0" -eq "$(_MK_IS_CONTEX_EXIST)" ]; then \
if [ "" = "$(CTX_CURRENT)" ]; then \
$(call _mk_err, "Not found context - undefined CTX value and current context CTX_CURRENT not set"); printf "\n";\
else \
if [ "" = "$(CTX)" ]; then \
make -s $(_TARGET_NAME_RAW) $(-*-command-variables-*-) CTX=$(CTX_CURRENT); \
else \
$(call _mk_warn, "Not found context CTX: '$(CTX)'."); \
$(call _mk_warn, "Default behavior is set: CTX=CTX_CURRENT - '$(CTX_CURRENT)'"); \
$(call _mk_ok, "– are you sure? [y/N]" ); \
read answer \
&& if [ $${answer:-'N'} = 'y' ]; then \
make -s $(_TARGET_NAME_RAW) $(NEW_COMMAND_VARIABLES) CTX=$(CTX_CURRENT); \
else \
$(call _mk_inf, "Canceled..."); \
fi; \
printf "\n"; \
fi; \
fi; \
else \
make -s $(_TARGET_NAME_RAW) $(-*-command-variables-*-); \
fi;
endef
# printf "cd $(_MKFILE_REALPATH_DIR) && make -s -f $(_MKFILE_REALPATH) $1 $(-*-command-variables-*-);";\
# make -s -f $(_MKFILE_REALPATH) $1 $(-*-command-variables-*-);
#
#if [ "1" = "$(_MKFILE_LINK)" ]; then \
# printf "cd $(_MKFILE_REALPATH_DIR) && make -s -C $(_MKFILE_REALPATH_DIR) $1 $(-*-command-variables-*-);";\
# cd $(_MKFILE_REALPATH_DIR) \
# && make -s -C $(_MKFILE_REALPATH_DIR) $1 $(-*-command-variables-*-) \
# && exit 1;
# fi;
define __pre_target
$(eval _MK_DIR_PATH_CONTEXT = $(call addprefix, $(_MKFILE_REALPATH_DIR),$(_MK_CTX_PATH)))
endef
## ARGS = $(foreach a,$($(subst -,_,$1)_args),$(if $(value $a),$a="$($a)"))
### TAGETs:
test:
# @printf "$(CURRENT_MAKEFILE)"
# @printf "$(MKFILE_PATH)"
@printf "_ENVMAKEFILEPATH: $(_ENVMAKEFILEPATH)\n"
@printf "_MKFILE_REALPATH_DIR: $(_MKFILE_REALPATH_DIR)\n"
@printf "_MK_DIR_PATH_CONTEXT: $(_MK_DIR_PATH_CONTEXT)\n"
@printf "CTX_CURRENT: $(CTX_CURRENT)\n"
@printf "_MK_FN_DC_DEFAULT_ENV: $(_MK_FN_DC_DEFAULT_ENV)\n"
@$(call _mk_inf, "$@")
@printf "\n"
test-%:
@$(MAKE) --no-print-directory "$*.test";
### ---
#.PHONY: help
help: ## Show this help; `help.%` — detail helps; Check `help.about`
@$(MAKE) --no-print-directory checkdeps ## > /dev/null
@perl -e '$(HELP_FUN)' $(MAKEFILE_LIST)
### ---
### ---
# INIT: new context - create directory (context) & copy files from '.default'
@PHONY: initCtx init.ctx ctx.init new.ctx ctx.new
initCtx: context_init ## Create new 'context'-folder: CTX=<context>
initCTX: initCtx
init.ctx: initCtx
ctx.init: initCtx
new.ctx: initCtx
ctx.new: initCtx
# Adds service to context - copy service template files (<SRV>.yml; <SRV>.env) to context (direcotry)
# and update CTX template files: `dc.services.tmpl` and `dc.volumes.tmpl`
addCtxSrvRaw: context_add_service
addCtxSrv: ## Add service to context: SRV=<name> [SARGS=<service_args>]
@$(call __try_context_overwrite, addCtxSrvRaw)
add.ctx.srv: addCtxSrv
ctx.add.srv: addCtxSrv
srv.add.ctx: addCtxSrv
srv.ctx.add: addCtxSrv
# .PHONY: checkdeps
checkdeps:
@printf "\n"
# @echo -n "\nCheck dependencies"
# @echo -n "\n_ENVMAKE_FILE_EXIST: $(_ENVMAKE_FILE_EXIST)"
# @echo -n "\n_MKFILE_ENV: $(_MKFILE_ENV)"
# @echo -n "\n"
# @echo -n "\nCTX: get_context:" $(call get_context)
### ---
# CHECK: - is directory (context) present
#@PHONY: isCtx ctx.check check.ctx
isCtxRaw: context_check_is_exists
@$(call _mk_run, "Context exist: '$(CTX)'" );
@printf "\n"
isCtx: ## Check is 'context' exists
@$(call __try_context_overwrite, isCtxRaw)
isCTX: isCtx
check.ctx: isCtx
ctx.check: isCtx
### ---
# ADD: add context - add `env` for directory (context) & copy files from '.default'
# @PHONY: addCtx add.ctx ctx.add
# addCtx: context_add ## Add new 'env' from .default for CTX=<context>
# Prints exists contexts names
listCtx: context_list ## List all contexts
listCTX: listCtx
list.ctx: listCtx
ctx.list: listCtx
currentCtx: context_current ## Show current context
currentCTX: currentCtx
current.ctx: currentCtx
ctx.current: currentCtx
cur.ctx: currentCtx
ctx.cur: currentCtx
curCtx: currentCtx
curCTX: currentCtx
# Remove context - remove directory (context) & remove files
rmCtx: context_remove ## Remove 'context'-folder: CTX=<context>
rmCTX: rmCtx
rm.ctx: rmCtx
ctx.rm: rmCtx
# Checks is exist service with given name
isSrv: ## Check is 'service' template exists: SRV=<name>
ifeq (1, $(_MK_IS_SERVICE_EXIST))
@$(call _mk_run, "Service exist: '$(SERVICE)'" )
@$(call _mk_inf, "$(_MK_SRV_PATH)")
else
@$(call _mk_warn, "Service not exist: '$(SERVICE)'" )
endif
@printf "\n"
isSRV: isSrv
# Checks whether a service with the specified name exists in the specified context
isCtxSrvRaw: context_check_is_exists
@$(call is_service_in_ctx_tmpl, _MK_IS_CTX_SRV_EXIST)
@if [ "1" -eq "$(_MK_IS_CTX_SRV_EXIST)" ]; then \
$(call _mk_run, "Service: '$(SERVICE)' enabled at CTX: '$(CTX)'" ); \
else \
$(call _mk_err, "Service: '$(SERVICE)' disabled at CTX: '$(CTX)'" ); \
fi;
@printf "\n"
isCtxSrv: ## Check is service in context: SRV=<name>
@$(call __try_context_overwrite, isCtxSrvRaw)
# Prints the list of know services
listSrv: service_list ## List all known services present in `template` folder
listAllSrv: listSrv
srv.all: listSrv
list.srv: listSrv
srv.list: listSrv
srv.list.all: listSrv
srv.listAll: listSrv
srvList: listSrv
listSRV: listSrv
listSrvVersionRaw: service_version_list
listSrvVersion: ## List services with versions: SRV=<name>
@$(call __try_context_overwrite, listSrvVersionRaw)
list.srv.ver: listSrvVersion
srv.list.ver: listSrvVersion
srv.ver.list: listSrvVersion
listSrvVer: listSrvVersion
srvVerList: listSrvVersion
# Checks is service-file included to context service-template (`dc.services.tmpl`)
isCtxSrvEnabled:
@$(call _mk_run, "isCtxSrvEnabled: '$(SERVICE)'" );
@printf "\n"
@$(call is_service_in_ctx_tmpl)
# Includes service file to context service-template (`dc.services.tmpl`)
enableCtxSrvRaw: context_enable_service
enableCtxSrv: ## Enable service in context: SRV=<name>
@$(call __try_context_overwrite, enableCtxSrvRaw)
enable.ctx.srv: enableCtxSrv
ctx.enable.srv: enableCtxSrv
# Excludes service file from services-template (`dc.services.tmpl`) for given context <CTX>
disableCtxSrvRaw: context_disable_service
disableCtxSrv: ## Disable service in context: SRV=<name>
@$(call __try_context_overwrite, disableCtxSrvRaw)
disable.ctx.srv: disableCtxSrv
ctx.disable.srv: disableCtxSrv
# List services in context - prints list of services in context (directory)
listCtxSrvRaw: context_all_service_list
listCtxSrv: ## List services in context
@$(call __pre_target)
@$(call __try_context_overwrite, listCtxSrvRaw)
list.ctx.srv: listCtxSrv
ctx.list.srv: listCtxSrv
srv.ctx.list: listCtxSrv
list.ctx.all.srv: listCtxSrv
ctx.list.srv.all: listCtxSrv
srv.all.ctx.list: listCtxSrv
# srv.all.list.ctx: listCtxSrv
# List enabled services - prints list of added services in context file `dc.services.tmpl`
listEnabledCtxSrvRaw: context_enabled_service_list
listEnabledCtxSrv: ## List enabled services in context
@$(call __try_context_overwrite, listEnabledCtxSrvRaw)
list.ctx.enabled.srv: listEnabledCtxSrv
ctx.list.srv.enabled: listEnabledCtxSrv
srv.enabled.ctx.list: listEnabledCtxSrv
srv.enabled.list.ctx: listEnabledCtxSrv
# Removes service from context - remove service files (<SRV>.yml; <SRV>.env) from context (directory)
# and clear services and volumes templates: `dc.services.tmpl` and `dc.volumes.tmpl`
rmCtxSrvRaw: context_remove_service
rmCtxSrv: ## Remove service from context: SRV=<name>
@$(call __try_context_overwrite, rmCtxSrvRaw)
rm.ctx.srv: rmCtxSrv
ctx.rm.srv: rmCtxSrv
srv.rm.ctx: rmCtxSrv
srv.ctx.rm: rmCtxSrv
# Try to rescue some syntax errors, tries to eliminate discrepancies (WIP)
rescueCtxSrv: is_context_contain_service_entire ## Check and resque service files
resqueCtxSrv: rescueCtxSrv
rescue.ctx.srv: rescueCtxSrv
ctx.rescue.srv: rescueCtxSrv
srv.ctx.rescue: rescueCtxSrv
# Build context - create 'docker-compose.yml' & '.env' files
buildCtxRaw: context_build
buildCtx: ## Build context — create 'docker-compose.yml' & '.env' files
# @$(call __pre_target, $@)
@$(call __try_context_overwrite, buildCtxRaw)
build.ctx: buildCtx
ctx.build: buildCtx
# Clean current context files - remove 'docker-compose.yml' & '.env' files
## PHONY += rmCurrentCtx cleancontext clean.ctx ctx.clean
rmCurrentCtx: ## Remove current context soft link
# @$(call __pre_target, $@)
@rm -f .env
@rm -f docker-compose.yml
# Set context as current - launch context files to root directory
## PHONY += setCurrentCtx setcontext set.ctx ctx.set
setCurrentCtx: context_check_is_exists ##rmCurrentCtx ## Set context as current default: CTX=<context>
@$(eval _TARGET_RELATIVE_DEFAULT_YML=$(addprefix $(addprefix $(_MK_DIR_CONTEXT), $(CTX))/, $(_MK_FN_DC_DEFAULT_YML)))
@$(eval _TARGET_RELATIVE_DEFAULT_ENV=$(addprefix $(addprefix $(_MK_DIR_CONTEXT), $(CTX))/, $(_MK_FN_DC_DEFAULT_ENV)))
@$(shell echo -n "echo $(_TARGET_RELATIVE_DEFAULT_YML)")
@$(shell echo -n "echo $(_TARGET_RELATIVE_DEFAULT_ENV)")
@$(shell echo -n "echo CTX: $(CTX)")
@ln -sfn $(_TARGET_RELATIVE_DEFAULT_YML) docker-compose.yml
@ln -sfn $(_TARGET_RELATIVE_DEFAULT_ENV) .env
setcontext: setCurrentCtx
set.ctx: setCurrentCtx
ctx.set: setCurrentCtx
startInit: ## Start initial setup
@$(call _mk_warn, "This script unpacks the basic structure of files – are you sure? [y/N]" );
@read answer \
&& if [ $${answer:-'N'} = 'y' ]; then \
$(_MK_DIR_TEMPLATE)/makeinit.run; \
else \
$(call _mk_inf, "Canceled..."); \
fi;
@printf "\n"
## .PHONY: help.%
help.%: ## Show this help.%
@$(call __pre_target, $@)
$(eval _helpKey=$(shell printf "%s" $@ | sed 's/\./¦/g'))
#?? @printf "$(_helpKey)"
@printf "\n"
$(eval _MK_KEYMAP_FILES = $(realpath $(call addprefix, $(_MK_DIR_KVDB), $(_MK_FN_HELP_KVDB)) ))
$(eval include $(call addprefix, $(_MK_DIR_MKFILE), keymap.mk))
@printf "$(call keymap_val,$(_helpKey))"
@printf "\n"