Skip to content

Instantly share code, notes, and snippets.

@esimov
Last active July 4, 2022 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esimov/e34d401a8057463d6e1c6abc7bf35ce5 to your computer and use it in GitHub Desktop.
Save esimov/e34d401a8057463d6e1c6abc7bf35ce5 to your computer and use it in GitHub Desktop.
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