Make, shells and polyglot tests - How to write a cross-shell clean target.

When executing various Makefiles with w64devkit, you can occasionally run across a Windows program with a Makefile written for cmd.exe. Often the only thing broken about them is the conventional clean target, which uses del.exe and will only work under cmd.exe. make clean del *.o /s sh: del: not found make: *** [Makefile:734: clean] Error 127 Confusingly, even if you then open cmd.exe and run make clean from there, you still get the same error! ...

July 22, 2025 · 5 min