-
Notifications
You must be signed in to change notification settings - Fork 721
/
lib.mk
51 lines (48 loc) · 3.03 KB
/
lib.mk
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
## proftgt :: target -> profile -> fullnixmode -> devmode -> autostart -> autostay -> profiled -> backend -> IO ()
define proftgt
$(1): shell
$(1): PROFILE = $(2)-${ERA}
$(1): BACKEND = $(8)
ifeq ($(strip $(3)),true)
$(1): ARGS += --arg 'useCabalRun' false
endif
ifeq ($(strip $(4)),true)
$(1): ARGS += --arg 'workbenchDevMode' true
endif
ifeq ($(strip $(7)),true)
$(1): ARGS += --arg 'profiling' '"$(WB_PROFILING)"'
else
$(1): ARGS += --arg 'profiling' '"none"'
endif
ifeq ($(strip $(5))$(strip $(6)),truetrue)
$(1): CMD := start-cluster $(if ${ITER},--iterations ${ITER}) $(if ${ID},--ident ${ID}) $(if ${BATCH},--batch-name ${BATCH}); return
endif
ifeq ($(strip $(5))$(strip $(6)),truefalse)
$(1): RUN := start-cluster $(if ${ITER},--iterations ${ITER}) $(if ${ID},--ident ${ID}) $(if ${BATCH},--batch-name ${BATCH})
endif
ifeq ($(strip $(3))$(strip $(4))$(strip $(5))$(strip $(6)),falsetruefalsefalse)
define EXTRA_HELP +=
$(1): ## Shell for profile \033[34m$(2)\033[0m (also: \033[34m-auto -autostay -nix -autonix -prof\033[0m)\n
endef
endif
endef
define define_profile_targets
ID ?= $(shell git symbolic-ref HEAD | sed 's_/_\n_g' | tail -n1)
## defining this target profname nix dev auto stay profiled backend
$$(foreach prof,$(1),$$(eval $$(call proftgt,$$(prof), $$(prof),false, true,false,false, false, supervisor)))
$$(foreach prof,$(1),$$(eval $$(call proftgt,$$(prof)-prof, $$(prof),false, true,false,false, true, supervisor)))
$$(foreach prof,$(1),$$(eval $$(call proftgt,$$(prof)-autoprof, $$(prof),false, true, true,false, true, supervisor)))
$$(foreach prof,$(1),$$(eval $$(call proftgt,$$(prof)-profnix, $$(prof), true, true,false,false, true, supervisor)))
$$(foreach prof,$(1),$$(eval $$(call proftgt,$$(prof)-autoprofnix, $$(prof), true, true, true,false, true, supervisor)))
$$(foreach prof,$(1),$$(eval $$(call proftgt,$$(prof)-auto, $$(prof),false, true, true,false, false, supervisor)))
$$(foreach prof,$(1),$$(eval $$(call proftgt,$$(prof)-autostay, $$(prof),false, true, true, true, false, supervisor)))
$$(foreach prof,$(1),$$(eval $$(call proftgt,$$(prof)-nix, $$(prof), true,false,false,false, false, supervisor)))
$$(foreach prof,$(1),$$(eval $$(call proftgt,$$(prof)-autonix, $$(prof), true,false, true,false, false, supervisor)))
$$(foreach prof,$(1),$$(eval $$(call proftgt,$$(prof)-nomadexec, $$(prof), true,false,false,false, false, nomadexec)))
$$(foreach prof,$(1),$$(eval $$(call proftgt,$$(prof)-nomadexec-auto, $$(prof), true,false, true,false, false, nomadexec)))
endef
define define_profile_targets_nomadcloud
## defining this target profname nix dev auto stay profiled backend
$$(foreach prof,$(1),$$(eval $$(call proftgt,$$(prof), $$(prof), true,false,false,false, false, nomadcloud)))
$$(foreach prof,$(1),$$(eval $$(call proftgt,$$(prof)-auto, $$(prof), true,false, true,false, false, nomadcloud)))
endef