是的。您可以使用origin函数确定变量定义的位置。 ifneq (,$(findstring environment,$(origin LIB))) # LIB由环境定义 else # LIB以其他方式定义 endif