~bigbes/game-prototype-ftl

ref: 2cb11babde8944242d1ca99dd6e03d91a994f1ed game-prototype-ftl/Makefile -rw-r--r-- 566 bytes
2cb11bab — Eugene Blikh add Makefile, WASM loader shell, play-web target a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
.PHONY: run build build-wasm serve play-web

run:
	go run .

build:
	@mkdir -p bin
	go build -o bin/ftl-shape .

build-wasm:
	@mkdir -p web
	GOOS=js GOARCH=wasm go build -o web/main.wasm .
	cp "$$(go env GOROOT)/lib/wasm/wasm_exec.js" web/wasm_exec.js

serve:
	go run github.com/hajimehoshi/wasmserve@latest .

play-web:
	@mkdir -p web
	@case "$$(uname -s)" in \
	  Darwin) OPEN_CMD=open ;; \
	  Linux)  OPEN_CMD=xdg-open ;; \
	  *)      OPEN_CMD=: ;; \
	esac; \
	( sleep 1 && $$OPEN_CMD http://localhost:8080 ) & \
	go run github.com/hajimehoshi/wasmserve@latest .