首页 > 解决方案 > makefile 中的条件错误

问题描述

我的 MakeFile 中有以下命令:

.PHONY: lint
lint:
    eslint src --ext ts

.PHONY: component
component:
ifndef name
$(error name is not set. try 'make component name=')
endif

问题是当我运行make lint或任何其他命令时,make 退出并出现component.

我将如何阻止这种情况发生?

标签: makefilegnu-make

解决方案



推荐阅读