0
我在檢查我的ENVIRONMENT
變量是否爲空,並且是development
或production
。Makefile - 如何檢查變量是否爲空並且是兩個值之一
ENVIRONMENT ?= development
define ENV_CHECK
$(if $(or $(call seq,$(1),development),$(call seq,$(1),production)),true,false)
endef
.PHONY: test
test:
@echo "$(ENVIRONMENT)"
$(call ENV_CHECK,$(ENVIRONMENT))
我make test
失敗,下面的錯誤
# make test
development
false
make: *** [test] Error 1