GNU make wildcard alternative?

北战南征 提交于 2019-12-12 10:46:30

问题


I would like to select all files in directory but using FreeBSD's make.

In GNU make this approach works:

FILES=$(wildcard *.c)

I am using FreeBSD's make, not GNU make so I am looking for command that will work in FreeBSD's make.

As it s stated in bottom link, FreeBSD has it's own functions but I cannot find them.

Generic Makefile not working on FreeBSD


回答1:


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'


来源:https://stackoverflow.com/questions/29357259/gnu-make-wildcard-alternative

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!