task.mk/src/builtins.mk

33 lines
1.1 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
$(foreach v,$(PRINT_VARS),$(eval export $(v)))
.PHONY: vars v
vars v:
$(call py,vars_py,$(PRINT_VARS))
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-sh = $(call pysh,print_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
$(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
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