task.mk/src/builtins.mk

34 lines
1,015 B
Makefile
Raw Normal View History

2022-09-20 11:08:47 -05:00
# ---- [builtin recipes] ---- #
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
.PHONY: help h
help h:
$(call py,help_py)
.PHONY: _help
_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
### | 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
2022-09-05 12:23:17 -05:00
.PHONY:
2022-09-05 17:44:39 -05:00
_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
tprint = $(call py,info_py,$(1))
tprint-sh = $(call pysh,info_py,$(1))
2022-09-14 16:52:49 -05:00
tconfirm = $(call py,confirm_py,$(1))
## _update-task.mk | downloads latest development version of task.mk
2022-09-05 12:23:17 -05:00
_update-task.mk:
$(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-14 16:52:49 -05:00
export MAKEFILE_LIST