Last active
July 4, 2022 09:29
-
-
Save esimov/e34d401a8057463d6e1c6abc7bf35ce5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ifeq ($(OS),Windows_NT) | |
BROWSER = start | |
else | |
UNAME := $(shell uname -s) | |
ifeq ($(UNAME), Linux) | |
BROWSER = xdg-open | |
endif | |
ifeq ($(UNAME), Darwin) | |
BROWSER = open | |
endif | |
endif | |
.PHONY: all clean serve | |
all: wasm serve | |
wasm: | |
cp -f "$$(go env GOROOT)/misc/wasm/wasm_exec.js" ./js/ | |
GOOS=js GOARCH=wasm go build -o lib.wasm wasm.go | |
serve: | |
$(BROWSER) 'http://localhost:5000' | |
go run server.go | |
clean: | |
rm -f *.wasm | |
debug: | |
@echo $(UNAME) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment