I don't trust that mame clean. Here why, By the way. I moved MAME folder to C:\.
Might be one of the issues I'm having.
[MINGW64] C:\mame>make clean
GCC 6.3.0 detected
Cleaning genie
Cleaning...
make[1]: Entering directory 'C:/mame/src/devices/cpu/m68000'
Cleaning...
make[1]: Leaving directory 'C:/mame/src/devices/cpu/m68000'
=================================================EDIT.
Look like I got it fix.
Re-downloaded the source to C:\mame. No longer use the C:\msys64\src\mame path. Something was going on in that path.
Also not using the mame clean anymore. Went back to this command instead. RD /S /Q C:\msys64\src\mame\build Safer than sorry.
Anyway no more issues.
Archiving liboptional.a...
Compiling src/mame/mame.cpp...
Building driver list...
Emitting mamevers.rc...
Compiling resources scripts/resources/windows/mame/mame.rc...
34433 driver(s) found
Compiling generated/mame/mame/drivlist.cpp...
Linking mame64.exe...
Pointing out that I gonna start using this command for full clean up. git clean -d -f -X
New setup.
cd C:\mame
git clean -d -f -X
git pull -f
SET CONFIG_ARCHITECTURE=x64
call C:\msys64\win32\env.bat
make -j5 OPTIMIZE=3 SYMBOLS=1 SYMLEVEL=1 STRIP_SYMBOLS=1 TOOLS=1
RD /S /Q C:\mame\build
DEL /S /Q C:\mame\castool.exe; C:\mame\floptool.exe; C:\mame\imgtool.exe; C:\mame\jedutil.exe; C:\mame\ldresample.exe; C:\mame\ldverify.exe; C:\mame\ledutil.exe; C:\mame\nltool.exe; C:\mame\nlwav.exe; C:\mame\pngcmp.exe; C:\mame\regrep.exe; C:\mame\romcmp.exe; C:\mame\split.exe; C:\mame\src2html.exe; C:\mame\srcclean.exe; C:\mame\unidasm.exe
https://sites.google.com/site/o0kinghanco0o/mame_building_info