msxbuild/lib/make/mb_base.mk

43 lines
734 B
Makefile
Raw Normal View History

2020-12-23 17:14:13 +00:00
# OS cmds
ifeq ($(OS),Windows_NT)
MB_RM = del /F /Q
MB_RMDIR = RMDIR /S /Q
MB_MKDIR = mkdir
MB_COPY = copy
MB_ERRIGNORE = 2>NUL || true
MB_SEP=\\
2024-06-25 13:46:31 +00:00
MB_CACHE ?= %LOCALAPPDATA%
2020-12-23 17:14:13 +00:00
else
MB_RM = rm -f
MB_RMDIR = rm -rf
MB_MKDIR = mkdir -p
MB_COPY = cp
MB_ERRIGNORE = 2>/dev/null
MB_SEP=/
2024-06-25 13:46:31 +00:00
MB_CACHE ?= ~/.cache
2020-12-23 17:14:13 +00:00
endif
# Remove space after separator
MB_PSEP = $(strip $(MB_SEP))
2021-07-06 02:28:45 +00:00
# Needed for comma in call arguments (like for l80.com)
2021-07-06 01:52:02 +00:00
MB_COMMA:=,
2020-12-23 17:14:13 +00:00
define mb_clean
@echo === Cleaning build folder.
test $(1) && $(MB_RMDIR) $(1)
endef
define mb_mkdir
$(MB_MKDIR) $(1)
endef
define mb_delete
test $(1) && $(MB_RM) $(1)
endef
define mb_copy
$(MB_COPY) $(1) $(2)
endef
define mb_create_dist
tar -czf $(1) -C $(2) `ls $(2)`
endef