I have a project that works on Mac and Emscripten and now adding Windows support. I installed Jetbrains Clion which comes bundled with MinGW. Trying to build a simple application didn't work and now debugging the makefile. For some reason wildcard seems to be truncating the filename. I checked the filenames and looked for hidden special characters but all seems ok. Any ideas what I'm doing wrong?

EDIT: Adding text in addition to image (which works fine on macOS)
ifeq ($(findstring _win, $(MAKECMDGOALS)), _win)
PLATFORM := win
APPNAME := $(subst _win,,$(MAKECMDGOALS))
$(warning APPSRCDIR is $(APPSRCDIR))
$(warning APPNAME is $(APPNAME))
# gather the application files
$(warning $(wildcard $(APPSRCDIR)/$(APPNAME)/*.c))
APPOBJS := $(patsubst %.c, %.o, $(notdir $(filter-out $(wildcard $(APPSRCDIR)/$(APPNAME)/*.*.c),$(wildcard $(APPSRCDIR)/$(APPNAME)/*.c))))
$(warning APPOBJS is $(APPOBJS))
APPOBJS += $(patsubst %.c, %.o, $(notdir $(wildcard $(APPSRCDIR)/$(APPNAME)/*.win.c)))
$(warning APPOBJS is $(APPOBJS))
APPOBJS := $(addprefix $(BUILDDIR)/$(APPNAME)/$(PLATFORM)/, $(APPOBJS))
$(warning APPOBJS is $(APPOBJS))
endif