我在Windows上有makefile(.mke),我需要在一个以“make”开头的文件夹中计数目录,如果有多个这样的目录,则使用make if子句抛出exception。
例如,:
Files: Install.1.0, Install.2.0, Install.3.0..我有$(SrcRoot)变量,我需要计数这个文件夹中的目录,然后使if子句为"if (numberOfDirs > 1) throw an error.“
在我的例子中,会有一个例外,因为有3个安装。文件夹。
发布于 2015-10-21 01:44:04
如果您所说的“抛出异常”指的是使用错误消息进行中止,这将执行以下操作:
INSTALLS := $(wildcard $(SrcRoot)/Install*)
ifneq (,$(word 2,$(INSTALLS)))
$(error there are too many Install directories)
endifhttps://stackoverflow.com/questions/33242205
复制相似问题