mk64/util.mk
coco875 4c4cb36b4d
add compatibilty for Windows build (#564)
* Add Windows Support
* Modify readme instructions for windows building
* Remove unused files
* Modified extract_assets.py, new_extract_assets.py, and build.py to work on windows
2024-02-22 08:33:46 -07:00

22 lines
686 B
Makefile

# util.mk - Miscellaneous utility functions for use in Makefiles
# Throws an error if the value of the variable named by $(1) is not in the list given by $(2)
define validate-option
# value must be part of the list
ifeq ($$(filter $($(1)),$(2)),)
$$(error Value of $(1) must be one of the following: $(2))
endif
# value must be a single word (no whitespace)
ifneq ($$(words $($(1))),1)
$$(error Value of $(1) must be one of the following: $(2))
endif
endef
ifeq ($(OS),Windows_NT)
NULL_OUT := nul
else
NULL_OUT = /dev/null
endif
# Returns the path to the command $(1) if exists. Otherwise returns an empty string.
find-command = $(shell which $(1) 2> $(NULL_OUT))