GNU做通配符替代? [英] GNU make wildcard alternative?
本文介绍了GNU做通配符替代?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用FreeBSD的make选择目录中的所有文件.
I would like to select all files in directory but using FreeBSD's make.
在GNU中,使此方法有效:
In GNU make this approach works:
FILES=$(wildcard *.c)
我使用的是FreeBSD的make,而不是GNU的make,因此我正在寻找适用于FreeBSD的make的命令.
I am using FreeBSD's make, not GNU make so I am looking for command that will work in FreeBSD's make.
如底部链接中所述,FreeBSD拥有自己的功能,但我找不到它们.
As it s stated in bottom link, FreeBSD has it's own functions but I cannot find them.
推荐答案
您可以使用!=
在FreeBSD的make
中执行命令.例如:
You can use !=
to execute a command in FreeBSD's make
. E.g:
FILES!= ls *.c
或者如果您也想在子目录中查找文件;
or if you want to find files in subdirectories as well;
FILES!= find . -type f -name '*.c'
这篇关于GNU做通配符替代?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文