2020-09-14 10:33:05 +02:00
|
|
|
TAGS=
|
|
|
|
|
|
|
|
.PHONY: fmt vet get clean dev setdev test ServerMovieNight
|
|
|
|
|
|
|
|
all: fmt vet test MovieNight static/main.wasm settings.json
|
|
|
|
|
|
|
|
server: ServerMovieNight static/main.wasm
|
|
|
|
|
|
|
|
ServerMovieNight: *.go common/*.go
|
2021-01-08 10:42:40 +01:00
|
|
|
GOOS=${TARGET} GOARCH=${ARCH} go$(GO_VERSION) build -o MovieNight $(TAGS)
|
2020-09-14 10:33:05 +02:00
|
|
|
|
|
|
|
setdev:
|
|
|
|
$(eval export TAGS=-tags "dev")
|
|
|
|
|
|
|
|
dev: setdev all
|
|
|
|
|
|
|
|
MovieNight: *.go common/*.go
|
2021-01-08 10:42:40 +01:00
|
|
|
GOOS=${TARGET} GOARCH=${ARCH} go$(GO_VERSION) build -o MovieNight${EXT} $(TAGS)
|
2020-09-14 10:33:05 +02:00
|
|
|
|
|
|
|
static/js/wasm_exec.js:
|
2020-11-05 04:59:01 +01:00
|
|
|
cp $$(go$(GO_VERSION) env GOROOT)/misc/wasm/wasm_exec.js $@
|
2020-09-14 10:33:05 +02:00
|
|
|
|
|
|
|
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${EXT} ./static/main.wasm ./static/js/wasm_exec.js
|
|
|
|
|
|
|
|
fmt:
|
|
|
|
gofmt -w .
|
|
|
|
|
|
|
|
vet:
|
|
|
|
go$(GO_VERSION) vet $(TAGS) ./...
|
|
|
|
GOOS=js GOARCH=wasm go$(GO_VERSION) vet $(TAGS) ./...
|
|
|
|
|
|
|
|
test:
|
|
|
|
go$(GO_VERSION) test $(TAGS) ./...
|
|
|
|
|
|
|
|
# Do not put settings_example.json here as a prereq to avoid overwriting
|
|
|
|
# the settings if the example is updated.
|
|
|
|
settings.json:
|
|
|
|
cp settings_example.json settings.json
|