makefilewindowgnu-makemingw-w64

mingw64 Makefile:5: *** missing separator


I'm using mingw64 in Windows trying to invoke Makefile to run Go but keep getting:

Makefile:5: *** missing separator.

This is the Makefile:

BINARY_NAME=celeritasApp.exe

## build: builds all binaries
build:
    @go mod vendor
    @go build -o tmp/${BINARY_NAME} .
    @echo Celeritas built!

run: build
    @echo Staring Celeritas...
    @.\tmp\${BINARY_NAME} &
    @echo Celeritas started!

clean:
    @echo Cleaning...
    @go clean
    @del .\tmp\${BINARY_NAME}
    @echo Cleaned!

test:
    @echo Testing...
    @go test ./...
    @echo Done!

start: run
    
stop:
    @echo "Starting the front end..."
    @taskkill /IM ${BINARY_NAME} /F
    @echo Stopped Celeritas

restart: stop start

The make version:

xxxx@xxxxx MSYS /c/dev/my/go_apps/myapp
$ make --version
GNU Make 4.3
Built for x86_64-pc-msys
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.

Solution

  • The indents in Makefile must be real tab characters, not spaces.