I'm using mingw-w64 to build my program using gcc
on windows.
In my makefile, I'm doing the following to find all source files:
SRCS := $(shell find $(SRC_DIRS) -name '*.cpp' -or -name '*.c' -or -name '*.s')
As you can see below, the FIND
command makes my build crash.
File not found - *.cpp
FIND: Parameter format not correct
# ...
After using make -d
to see what's happening under the hood, I discovered that my makefile use system32\find.exe
instead of the find provided by MinGW.
$ make -d
# ...
Reading makefile 'Makefile'...
CreateProcess(C:\WINDOWS\system32\find.exe,find ./src -name *.cpp -or -name *.c -or -name
File not found - *.cpp
*.s,...)
# ...
Is there a way to force make to use the proper find
command?
If not, how to address this portability issue?
EDIT:
It looks like I'm punished for doing fancy stuff.
As mentioned in the comments, minGW-w64 doesn't come with a FIND
util.
My new problem is therefore to translate the following lines for windows:
SRC_DIRS := ./src
SRCS := $(shell find $(SRC_DIRS) -name '*.cpp' -or -name '*.c' -or -name '*.s')
INC_DIRS := $(shell find $(SRC_DIRS) -type d)
Thank you all for your answers.