diff --git a/Makefile b/Makefile index 7dcda28..e7fa083 100644 --- a/Makefile +++ b/Makefile @@ -5,21 +5,23 @@ # For info on installing extra versions, see this page: # https://golang.org/doc/install#extra_versions -# goosList = "android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris windows" -# goarchList = "386 amd64 amd64p32 arm arm64 ppc64 ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32leppc s390 s390x sparc sparc64" - TAGS= +# Windows needs the .exe extension. +ifeq ($(OS),Windows_NT) +EXT=.exe +endif + .PHONY: fmt vet get clean dev setdev test ServerMovieNight -all: fmt vet test MovieNight static/main.wasm settings.json +all: fmt vet test MovieNight$(EXT) static/main.wasm settings.json # Build the server deployment server: ServerMovieNight static/main.wasm # Bulid used for deploying to my server. ServerMovieNight: *.go common/*.go - GOOS=${TARGET} GOARCH=${ARCH} go$(GO_VERSION) build -o MovieNight $(TAGS) + GOOS=linux GOARCH=386 go$(GO_VERSION) build -o MovieNight $(TAGS) setdev: $(eval export TAGS=-tags "dev") @@ -36,7 +38,7 @@ static/main.wasm: static/js/wasm_exec.js wasm/*.go common/*.go GOOS=js GOARCH=wasm go$(GO_VERSION) build -o $@ $(TAGS) wasm/*.go clean: - -rm MovieNight ./static/main.wasm ./static/js/wasm_exec.js + -rm MovieNight$(EXT) ./static/main.wasm ./static/js/wasm_exec.js fmt: gofmt -w .