task.mk/src/builtins.mk

33 lines
1.2 KiB
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
h help: ## show this help
2023-01-19 12:21:12 -06:00
$(call py,help_py)
2022-09-05 12:23:17 -05:00
_help: export SHOW_HIDDEN=true
_help: help
ifdef PRINT_VARS
TASKMK_VARS=$(subst $(eval ) ,<|>,$(foreach v,$(PRINT_VARS),$(v)=$($(v))))
2022-09-05 12:23:17 -05:00
.PHONY: vars v
v vars:
$(call py,vars_py,$(TASKMK_VARS))
2022-09-05 12:23:17 -05:00
endif
### |> -ws --hidden
### task.mk builtins: |> -d --hidden
_print-ansi: ## show all possible ansi color code combinations
2022-09-05 17:44:39 -05:00
$(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-verbose= $(call py-verbose,print_py,$(1))
2022-09-14 16:52:49 -05:00
tconfirm = $(call py,confirm_py,$(1))
2023-01-20 12:35:52 -06:00
_update-task.mk: ## downloads version of task.mk (TASKMK_VERSION=)
$(call tprint,{a.b_cyan}Updating task.mk{a.end})
2023-01-20 12:35:52 -06:00
curl https://raw.githubusercontent.com/daylinmorgan/task.mk/$(TASKMK_VERSION)/task.mk -o .task.mk
2022-09-25 17:43:12 -05:00
.PHONY: h help _help _print-ansi _update-task.mk
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
SHELL := $(shell which bash)
2022-09-21 16:20:51 -05:00
endif