6

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

Community
  • 1
  • 1
antifriz
  • 873
  • 2
  • 13
  • 20
  • I don't really know bsd make but quick searching doesn't indicate anything being available for this specifically. The only thing I can see is the fact that targets and sources can contain shell wildcard characters (which is true in GNU make also). – Etan Reisner Mar 30 '15 at 22:38

1 Answers1

7

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'
Roland Smith
  • 42,427
  • 3
  • 64
  • 94