Make Error: Make not recognizing commands in makefile

Hi,

Ive been making changes to the ODrive firmware and have consistantly been running into the issue where operators and commands in the makefile are not recognised. I am building this in windows with all the prerequisites installed and added to path.

When I run make from the command line, the following errors are thrown at me:

board version: v3.6-56V
Firmware version 0.5.2-dev (fw-v0.5.2-19-gc8b725b6*)
 [     ] 100%
'!' is not recognized as an internal or external command,
operable program or batch file.
'cp' is not recognized as an internal or external command,       
operable program or batch file.
make: *** [Makefile:35: all] Error 1

This happens regardless of whether I run the command in Powershell or Command Prompt.
While make does generate the necessary build files which i can flash with STM32CubeProgrammer, I am not able to run make flash, make clean without similar errors.

From my understanding ‘!’ and ‘cp’ are known to Powershell but not to Command Prompt, so is it possible make is using Command Prompt somehow even when it is run from powershell?? (doesnt sound right to me)

Here is a pic of the culprit lines of code in the makefile starting from line 37

Any help debugging this would be greatly appreciated

Hit me with a make --version

It is using version 4.3

PS C:\Users\goodw\OneDrive\Documents\Skateboard\ODrive\Firmware> make --version
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.

Hmm… Open powershell through your start menu and try man cp

It tells me it is an alias of Copy-Item.

PS C:\Users\goodw> man cp

NAME
    Copy-Item

SYNTAX
    Copy-Item [-Path] <string[]> [[-Destination] <string>] [-Container] [-Force] [-Filter <string>] [-Include
    <string[]>] [-Exclude <string[]>] [-Recurse] [-PassThru] [-Credential <pscredential>] [-WhatIf] [-Confirm]
    [-UseTransaction] [-FromSession <PSSession>] [-ToSession <PSSession>]  [<CommonParameters>]

    Copy-Item [[-Destination] <string>] -LiteralPath <string[]> [-Container] [-Force] [-Filter <string>] [-Include
    <string[]>] [-Exclude <string[]>] [-Recurse] [-PassThru] [-Credential <pscredential>] [-WhatIf] [-Confirm]
    [-UseTransaction] [-FromSession <PSSession>] [-ToSession <PSSession>]  [<CommonParameters>]


ALIASES
    cpi
    cp
    copy


REMARKS
    Get-Help cannot find the Help files for this cmdlet on this computer. It is displaying only partial help.
        -- To download and install Help files for the module that includes this cmdlet, use Update-Help.
        -- To view the Help topic for this cmdlet online, type: "Get-Help Copy-Item -Online" or
           go to https://go.microsoft.com/fwlink/?LinkID=113292.

Hi there,

I encounter the same problem, after installing the dev tools on my new pc.
Has anyone found a solution for this?

The only way for me currently to get this bug away, is to leave out the following code section in the make file:

# Copy libfibre files to odrivetool if they were built
# @ ! test -f "fibre-cpp/build/libfibre-linux-amd64.so" || copy fibre-cpp/build/libfibre-linux-amd64.so ../tools/odrive/pyfibre/fibre/
# @ ! test -f "fibre-cpp/build/libfibre-linux-armhf.so" || copy fibre-cpp/build/libfibre-linux-armhf.so ../tools/odrive/pyfibre/fibre/
# @ ! test -f "fibre-cpp/build/libfibre-linux-aarch64.so" || copy fibre-cpp/build/libfibre-linux-aarch64.so ../tools/odrive/pyfibre/fibre/
# @ ! test -f "fibre-cpp/build/libfibre-macos-x86.dylib" || copy fibre-cpp/build/libfibre-macos-x86.dylib ../tools/odrive/pyfibre/fibre/
# @ ! test -f "fibre-cpp/build/libfibre-windows-amd64.dll" || copy fibre-cpp/build/libfibre-windows-amd64.dll ../tools/odrive/pyfibre/fibre/

However I don’t know what this code is for, and suspect I will break stuff if I leave this out.

Regards, JP

You know, I never tracked this down. Where did you even get make for windows32?

Use the one included in this package Releases · xpack-dev-tools/windows-build-tools-xpack · GitHub