2022-09-20 11:08:47 -05:00
|
|
|
# ---- [builtin recipes] ---- #
|
2022-09-20 17:09:42 -05:00
|
|
|
ifeq (help,$(firstword $(MAKECMDGOALS)))
|
|
|
|
HELP_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
|
|
|
|
export HELP_ARGS
|
|
|
|
endif
|
2022-09-05 12:23:17 -05:00
|
|
|
## h, help | show this help
|
2022-09-22 10:39:53 -05:00
|
|
|
h help:
|
2022-09-24 15:24:36 -05:00
|
|
|
$(call py,help_py) || { echo "exiting early!"; exit 1; }
|
2022-09-05 12:23:17 -05:00
|
|
|
_help: export SHOW_HIDDEN=true
|
|
|
|
_help: help
|
|
|
|
ifdef PRINT_VARS
|
|
|
|
$(foreach v,$(PRINT_VARS),$(eval export $(v)))
|
|
|
|
.PHONY: vars v
|
|
|
|
vars v:
|
|
|
|
$(call py,vars_py,$(PRINT_VARS))
|
|
|
|
endif
|
2022-09-14 17:15:46 -05:00
|
|
|
### | args: -ws --hidden
|
|
|
|
### task.mk builtins: | args: -d --hidden
|
2022-09-05 17:44:39 -05:00
|
|
|
## _print-ansi | show all possible ansi color code combinations
|
|
|
|
_print-ansi:
|
|
|
|
$(call py,print_ansi_py)
|
2022-09-05 12:23:17 -05:00
|
|
|
# functions to take f-string literals and pass to python print
|
2022-10-03 16:02:30 -05:00
|
|
|
tprint = $(call py,print_py,$(1))
|
|
|
|
tprint-sh = $(call pysh,print_py,$(1))
|
2022-09-14 16:52:49 -05:00
|
|
|
tconfirm = $(call py,confirm_py,$(1))
|
2022-09-14 17:15:46 -05:00
|
|
|
## _update-task.mk | downloads latest development version of task.mk
|
2022-09-05 12:23:17 -05:00
|
|
|
_update-task.mk:
|
2022-09-14 17:15:46 -05:00
|
|
|
$(call tprint,{a.b_cyan}Updating task.mk{a.end})
|
2022-09-05 12:23:17 -05:00
|
|
|
curl https://raw.githubusercontent.com/daylinmorgan/task.mk/main/task.mk -o .task.mk
|
2022-09-25 17:43:12 -05:00
|
|
|
.PHONY: h help _help _print-ansi _update-task.mk
|
2022-09-24 17:25:15 -05:00
|
|
|
TASK_MAKEFILE_LIST := $(filter-out $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
|
|
|
export MAKEFILE_LIST MAKE TASK_MAKEFILE_LIST
|
2022-09-21 16:20:51 -05:00
|
|
|
ifndef INHERIT_SHELL
|
2022-09-22 10:39:53 -05:00
|
|
|
SHELL := $(shell which bash)
|
2022-09-21 16:20:51 -05:00
|
|
|
endif
|