Files
ultrasm64-2/lib/hackerlibultra/util.mk
username ad88263101 git subrepo clone https://github.com/HackerN64/hackerlibultra lib/hackerlibultra
subrepo:
  subdir:   "lib/hackerlibultra"
  merged:   "08e84e89"
upstream:
  origin:   "https://github.com/HackerN64/hackerlibultra"
  branch:   "main"
  commit:   "08e84e89"
git-subrepo:
  version:  "0.4.9"
  origin:   "???"
  commit:   "???"
2025-02-18 12:41:47 -05:00

17 lines
611 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
# Returns the path to the command $(1) if exists. Otherwise returns an empty string.
find-command = $(shell which $(1) 2>/dev/null)