I'm using this rwildcard
make function (taken from https://stackoverflow.com/a/18258352)
ifeq ($(OS),Windows_NT)
SHELL := cmd
endif
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
INPUT_JavaFileStorageTest-AS = $(call rwildcard,src/java/android-filechooser-AS/app/src,*) $(call rwildcard,src/java/JavaFileStorage/app/src,*) $(call rwildcard,src/java/JavaFileStorageTest-AS/app/src,*.java)
However, I noticed that:
- while on linux this is rather fast (cannot perceive the duration)
- on Windows this is actually very slow. (10 seconds)
[SHELL is voluntarily set tocmd
on windows because the user might not have a POSIX shell in its path].
Any idea why this? How can I improve this?
This should work with both GNU make 3.x & 4.x (because on macOS it is version 3.x that is shipped in the devel command line tools, there is no 4.x there)
EDIT
After investigation the problem wasn't the recursive wildcard. I could speed up by running make --no-builtin-rules
or adding MAKEFLAGS += --no-builtin-rules
in the Makefile, or adding .SUFFIXES:
(with empty value). This removed all the lag observed on Windows.