Why do I get a "/usr/bin/bash" error when trying to compile a project with an external makefile in Windows®?

Error example:

make -f nbproject/Makefile-MyConfiguration.mk SUBPROJECTS= .clean-conf
make[1]: Entering directory 'V:/SVB/PIC/FW/me/uCWorkspace/ide_workspaces/windows/mplab/pic_test1.X'
cd /D ../../../../uCProjects/apps/PIC_test && ../../../../tools/windows/make/make4.1/bin/make.exe clean
nbproject/Makefile-MyConfiguration.mk:5: recipe for target '.clean-conf' failed
make[1]: Leaving directory 'V:/SVB/PIC/FW/me/uCWorkspace/ide_workspaces/windows/mplab/pic_test1.X' 
nbproject/Makefile-impl.mk:44: recipe for target '.clean-impl' failed
/usr/bin/bash: line 0: cd: /D: No such file or directory


The cause is a possible bug in the GNU make tool. Also, the 'sh' tool is installed on the PC and can be launched from Windows® Command Prompt line.


Make the sh.exe tool un-callable from Windows Command Prompt. There are different options to do this:

  1. Remove the c:\cygwin\bin\ or/and C:\MinGW\bin\ from PATH - Environment Variables. Note that the installation folders can have a different name on your PC.
  2. Rename sh.exe file to sh_.exe from c:\cygwin\bin\ or c:\MinGW\bin\.
  3. Rename the Cygwin/Mingw folder.
© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.