2024-07-05 22:11:54 +00:00
|
|
|
|
|
2024-07-10 12:05:38 +00:00
|
|
|
|
MB_OS_RM ?= rm -f
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-variable-rock,MB_OS_RM,Native OS delete command.)
|
2024-07-10 12:05:38 +00:00
|
|
|
|
|
|
|
|
|
MB_OS_RMDIR ?= rm -rf
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-variable-rock,MB_OS_RMDIR,Native OS remove folder command.)
|
2024-07-10 12:05:38 +00:00
|
|
|
|
|
|
|
|
|
MB_OS_MKDIR ?= mkdir -p
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-variable-rock,MB_OS_MKDIR,Native OS create folder command.)
|
2024-07-10 12:05:38 +00:00
|
|
|
|
|
|
|
|
|
MB_OS_COPY ?= cp
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-variable-rock,MB_OS_COPY,Native OS copy command.)
|
2024-07-10 12:05:38 +00:00
|
|
|
|
|
|
|
|
|
MB_OS_STDOUT_IGNORE ?= >/dev/null
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-variable-rock,MB_OS_STDOUT_IGNORE,Native OS ignore stdout.)
|
2024-07-10 12:05:38 +00:00
|
|
|
|
|
|
|
|
|
MB_OS_STDERR_IGNORE ?= 2>/dev/null
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-variable-rock,MB_OS_STDERR_IGNORE,Native OS ignore stderr.)
|
2024-07-10 12:05:38 +00:00
|
|
|
|
|
|
|
|
|
MB_OS_SEP ?=/
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-variable-rock,MB_OS_SEP,Native OS path seperator.)
|
2024-07-10 12:05:38 +00:00
|
|
|
|
|
|
|
|
|
MB_OS_CACHE ?= ~/.cache
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-variable-rock,MB_OS_CACHE,Native OS application cache folder.)
|
2024-07-10 12:05:38 +00:00
|
|
|
|
|
2024-07-16 17:32:08 +00:00
|
|
|
|
MB_OS_TERM_COLORS ?= $(shell tput colors 2> /dev/null;test $$? -eq 0 || echo -1)
|
|
|
|
|
$(call mb-make-call,mb-doc-variable-rock,MB_OS_TERM_COLORS,Native OS terminal color count support.)
|
2024-07-05 22:11:54 +00:00
|
|
|
|
|
2024-07-07 14:33:49 +00:00
|
|
|
|
|
2024-07-10 12:05:38 +00:00
|
|
|
|
ifdef OS
|
|
|
|
|
ifeq ($(OS),Windows_NT)
|
2024-07-12 15:59:26 +00:00
|
|
|
|
$(MB_ᕽᕽᕽ )MB_OS_RM ?= del /F /Q
|
|
|
|
|
$(MB_ᕽᕽᕽ )MB_OS_RMDIR ?= RMDIR /S /Q
|
|
|
|
|
$(MB_ᕽᕽᕽ )MB_OS_MKDIR ?= mkdir
|
|
|
|
|
$(MB_ᕽᕽᕽ )MB_OS_COPY ?= copy
|
|
|
|
|
$(MB_ᕽᕽᕽ )MB_OS_STDOUT_IGNORE ?= >NUL
|
|
|
|
|
$(MB_ᕽᕽᕽ )MB_OS_STDERR_IGNORE ?= 2>NUL || true
|
|
|
|
|
$(MB_ᕽᕽᕽ )MB_OS_SEP ?=\
|
|
|
|
|
$(MB_ᕽᕽᕽ )MB_OS_CACHE ?= %LOCALAPPDATA%
|
|
|
|
|
$(MB_ᕽᕽᕽ )MB_OS_TERM_COLORS ?= -1
|
2024-07-10 12:05:38 +00:00
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
2024-07-16 15:20:47 +00:00
|
|
|
|
define mb-os-file-empty
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(file >$(1))
|
2024-07-07 14:33:49 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-os-file-empty,Makes an file empty.,<file>)
|
2024-07-16 15:20:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
define mb-os-file-append
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(file >>$(1),$(2))
|
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-os-file-append,Appends text to an file,<file> <text>)
|
2024-07-07 14:33:49 +00:00
|
|
|
|
|
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-os-file-copy
|
2024-07-13 13:05:01 +00:00
|
|
|
|
$(MB_ᕽᕽᕽ )$(MB_OS_COPY) $(1) $(2)
|
2024-07-07 14:33:49 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-os-file-copy,Copy an file.,<in> <out>)
|
2024-07-07 14:33:49 +00:00
|
|
|
|
|
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-os-file-delete
|
2024-07-12 15:59:26 +00:00
|
|
|
|
$(MB_ᕽᕽᕽ )$(MB_OS_RM) $(1)
|
2024-07-07 14:33:49 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-os-file-delete,Deletes an file.,<file>)
|
2024-07-07 14:33:49 +00:00
|
|
|
|
|
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-os-file-touch
|
2024-07-13 13:05:01 +00:00
|
|
|
|
$(MB_ᕽᕽᕽ )touch $(1)
|
2024-07-07 14:33:49 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-os-file_touch,Changes file timestamps.,<file>)
|
2024-07-13 13:05:01 +00:00
|
|
|
|
|
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-os-dir-delete
|
2024-07-13 13:05:01 +00:00
|
|
|
|
$(MB_ᕽᕽᕽ )$(MB_OS_RMDIR) $(1)
|
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-os-dir-delete,Delete the full folder.,<dir>)
|
2024-07-13 13:05:01 +00:00
|
|
|
|
|
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-os-dir-create
|
2024-07-13 13:05:01 +00:00
|
|
|
|
$(MB_ᕽᕽᕽ )$(MB_OS_MKDIR) $(1)
|
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function,mb-os-dir-create,Creates an folder.,<dir>)
|
2024-07-07 14:33:49 +00:00
|
|
|
|
|
2024-07-08 02:23:37 +00:00
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-os-crayon-tagged-echo
|
2024-07-12 15:59:26 +00:00
|
|
|
|
$(MB_ᕽᕽᕽ )$(if $(filter -1,$(MB_OS_TERM_COLORS)),@echo $(MB_I18N_OS_CRAYON_TAG) $(2),@echo -e "\x1B[$(1)m$(MB_I18N_OS_CRAYON_TAG)\x1B[39m $(2)")
|
2024-07-08 02:23:37 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function-deep,mb-os-crayon-tagged-echo,Echo's an prefixed message to stdout with ansi color code.,<color-code> <message>)
|
2024-07-08 02:23:37 +00:00
|
|
|
|
|
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-os-echo-report
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,mb-os-crayon-tagged-echo,31,$(1))
|
2024-07-08 02:23:37 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function-deep,mb-os-echo-report,Echo's an message to stdout with 'red' crayon.,<message>)
|
2024-07-08 02:23:37 +00:00
|
|
|
|
|
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-os-echo-good
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,mb-os-crayon-tagged-echo,32,$(1))
|
2024-07-10 12:05:38 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function-deep,mb-os-echo-good,Echo's an message to stdout with 'green' crayon.,<message>)
|
2024-07-10 12:05:38 +00:00
|
|
|
|
|
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-os-echo-assert
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,mb-os-crayon-tagged-echo,33,$(1))
|
2024-07-10 12:05:38 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function-deep,mb-os-echo-assert,Echo's an message to stdout with 'yellow' crayon.,<message>)
|
2024-07-10 12:05:38 +00:00
|
|
|
|
|
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-os-echo-command
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,mb-os-crayon-tagged-echo,34,$(1))
|
2024-07-08 02:23:37 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function-deep,mb-os-echo-command,Echo's an message to stdout with 'blue' crayon.,<message>)
|
2024-07-08 02:23:37 +00:00
|
|
|
|
|
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-os-echo-phase
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,mb-os-crayon-tagged-echo,35,$(1))
|
2024-07-08 02:23:37 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function-deep,mb-os-echo-phase,Echo's an message to stdout with 'magenta' crayon.,<message>)
|
2024-07-08 02:23:37 +00:00
|
|
|
|
|
|
|
|
|
|
2024-07-16 14:45:37 +00:00
|
|
|
|
define mb-os-echo-remark
|
|
|
|
|
$(MB_ᕽᕽᕽ )$(call mb-make-call,mb-os-crayon-tagged-echo,36,$(1))
|
2024-07-08 02:23:37 +00:00
|
|
|
|
endef
|
2024-07-16 17:32:08 +00:00
|
|
|
|
$(call mb-make-call,mb-doc-function-deep,mb-os-echo-alert,Echo's an message to stdout with 'cyan' crayon.,<message>)
|
2024-07-08 02:23:37 +00:00
|
|
|
|
|