New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Makefile for Windows #843
Comments
This is using Unix shell syntax (bash / zsh), I wonder what 'make' is running it. You could try using "set" on an extra line set GOARCH=wasm
set GOOS=js
go build -o web/app.wasm Disclaimer: I am not a Windows guy (anymore). We usually don't compile for Windows on Windows. Instead, we cross compile using an Earthly builder on Linux from a Mac, which is our standard developer system. I think it would work with a Makefile, if you use something like CygWin (what I used in the past, maybe read up on How To Use Makefiles on Windows). When on Windows, I usually have WSL2 (and Docker) running for development. But, I am certain, that the "Windows" people here can tell you their best practices. |
Easiest way is to run |
I think that using Mage is actually a nicer option than using make in general. This will work on Windows too and even without a local mage installation (which is trivial when running Go). That way, it is fully independent of the shell. I used this for the go-nats-app example (magefile.go). The example shows the two stage compilation and can easily be extended and reused for other projects. We have some large ones which can create docker images, handle deployment and auto-recompile on code changes and such stuff. Besides that, I would again recommend using Earthly when projects get larger. This is our solution for "everything" (CI/CD) with occasional extra scripts (as the build environment is containerized, They have a nice tutorial and the "final" Earthfile version for Go is easy to understand. It will allow all the nifty Linux tools) or |
Hello,
In documentation I see
but when I run this makefile I got error
I think this problem is because I develop on windows. Someone can tell me, how should I build app?
The text was updated successfully, but these errors were encountered: