I'm trying to build a project, bootloader for AVR devices provided by LUFA, that uses GNU Make (make
), but I am on Windows. While Windows, in and of itself, isn't necessarily the problem, it's clearly throwing a wrench in things.
I've installed make
and other ancillary programs (grep, mingw, ...) via Chocolatey. I've also installed Cygwin/MinGW on their at times but believe I'm not using those binaries... but maybe they're not helping...
I'm running make
and get an error before even the first make target is executed:
#...
test:
echo test
#...
Result:
C:\Users\camer\git\Project\bootloader>make
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
echo test
test
make -d
seems to show what is causing the The system cannot find the path specified.
errors:
PS C:\Users\camer\git\Project\bootloader> make -d
GNU Make 4.3
Built for Windows32
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Reading makefile 'Makefile'...
CreateProcess(C:\WINDOWS\system32\hostname.exe,hostname,...)
Main thread handle = 00000110
Reading makefile 'local.HOSTNAME.mk' (search path) (don't care) (no ~ expansion)...
Reading makefile 'LUFA/LUFA/Build/LUFA/lufa-sources.mk' (search path) (no ~ expansion)...
Reading makefile 'LUFA/LUFA/Build/LUFA/lufa-gcc.mk' (search path) (no ~ expansion)...
Reading makefile 'LUFA/LUFA/Build/DMBS/DMBS/core.mk' (search path) (no ~ expansion)...
Reading makefile 'LUFA/LUFA/Build/DMBS/DMBS/cppcheck.mk' (search path) (no ~ expansion)...
Reading makefile 'LUFA/LUFA/Build/DMBS/DMBS/core.mk' (search path) (no ~ expansion)...
Reading makefile 'LUFA/LUFA/Build/DMBS/DMBS/doxygen.mk' (search path) (no ~ expansion)...
Reading makefile 'LUFA/LUFA/Build/DMBS/DMBS/core.mk' (search path) (no ~ expansion)...
Reading makefile 'LUFA/LUFA/Build/DMBS/DMBS/dfu.mk' (search path) (no ~ expansion)...
Reading makefile 'LUFA/LUFA/Build/DMBS/DMBS/core.mk' (search path) (no ~ expansion)...
Reading makefile 'LUFA/LUFA/Build/DMBS/DMBS/gcc.mk' (search path) (no ~ expansion)...
Reading makefile 'LUFA/LUFA/Build/DMBS/DMBS/core.mk' (search path) (no ~ expansion)...
Creating temporary batch file C:\Users\camer\AppData\Local\Temp\make14552-1.bat
Batch file contents:
@echo off
mkdir -p obj 2> /dev/null
CreateProcess(C:\Users\camer\AppData\Local\Temp\make14552-1.bat,C:\Users\camer\AppData\Local\Temp\make14552-1.bat,...)
The system cannot find the path specified.
Cleaning up temporary batch file C:\Users\camer\AppData\Local\Temp\make14552-1.bat
...
So, it looks like make
is trying some workaround on Windows that creates a temporary batch (.bat
) file and executes that to get some output. Or maybe that's standard practice and it creates a .sh
script on Linux... In any case, that seems to be what's failing for some reason.
Looking into LUFA's included Makefiles (LUFA/LUFA/Build/DMBS/DMBS/*.mk
), I can see the instructions that are trying to be run:
#...
# Create the output object file directory if it does not exist and add it to the virtual path list
$(shell mkdir -p $(OBJDIR) 2> /dev/null)
#...
So, something about Make's builtin shell
is failing on Windows 10.
Curiously, these errors do not make the build fail. You can see in my example that echo test
is still run.
It turns out, this is causing a litany of other issues with LUFA's Makefiles. The shell
builtin is used to fill many make vars and many build steps expect those variables to be non-empty. Since the shell
call fails without taking down the whole execution, everything breaks.
I'm not quite sure where next to look to solve my issue. Is it that I'm using a bad version of make
? I've tried a few make.exe
binaries from different places and they all have this error (if memory serves). I'm pretty sure I've had these make files working on a previous Windows installation but that computer is now offline so I cannot compare.
Thanks for the look! Cheers!