From 2e45392f6896de5f66d1b80d6afc54c90b179849 Mon Sep 17 00:00:00 2001 From: Zorglube <630192+zorglube@users.noreply.github.com> Date: Wed, 17 Mar 2021 00:07:44 +0100 Subject: [PATCH] Finally found a way to correctly build on BSD, so remove BSD specific Makefile. --- Makefile | 46 ++++++++++++++++++++++++++++++++++++++++++-- Makefile.BSD | 12 ------------ make/Makefile.common | 42 ---------------------------------------- readme.md | 4 ++-- 4 files changed, 46 insertions(+), 58 deletions(-) delete mode 100644 Makefile.BSD delete mode 100755 make/Makefile.common diff --git a/Makefile b/Makefile index cf476cd..d1d00a2 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,51 @@ # 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" -include make/Makefile.common # Windows needs the .exe extension. ifeq ($(OS),Windows_NT) -EXT=.exe +EXT=.exe endif + +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 + GOOS=${TARGET} GOARCH=${ARCH} go$(GO_VERSION) build -o MovieNight $(TAGS) + +setdev: + $(eval export TAGS=-tags "dev") + +dev: setdev all + +MovieNight: *.go common/*.go + GOOS=${TARGET} GOARCH=${ARCH} go$(GO_VERSION) build -o MovieNight${EXT} $(TAGS) + +static/js/wasm_exec.js: + cp $$(go$(GO_VERSION) env GOROOT)/misc/wasm/wasm_exec.js $@ + +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 diff --git a/Makefile.BSD b/Makefile.BSD deleted file mode 100644 index f49a3f2..0000000 --- a/Makefile.BSD +++ /dev/null @@ -1,12 +0,0 @@ -# If a different version of Go is installed (via `go get`) set the GO_VERSION -# environment variable to that version. For example, setting it to "1.13.7" -# will run `go1.13.7 build [...]` instead of `go build [...]`. -# -# 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" -include make/Makefile.common - -GOOS=freebsd diff --git a/make/Makefile.common b/make/Makefile.common deleted file mode 100755 index e179728..0000000 --- a/make/Makefile.common +++ /dev/null @@ -1,42 +0,0 @@ -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 - GOOS=${TARGET} GOARCH=${ARCH} go$(GO_VERSION) build -o MovieNight $(TAGS) - -setdev: - $(eval export TAGS=-tags "dev") - -dev: setdev all - -MovieNight: *.go common/*.go - GOOS=${TARGET} GOARCH=${ARCH} go$(GO_VERSION) build -o MovieNight${EXT} $(TAGS) - -static/js/wasm_exec.js: - cp $$(go$(GO_VERSION) env GOROOT)/misc/wasm/wasm_exec.js $@ - -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 diff --git a/readme.md b/readme.md index 868525d..0ccc7a4 100644 --- a/readme.md +++ b/readme.md @@ -38,14 +38,14 @@ You have to : - download `git clone https://github.com/zorchenhimer/MovieNight`, go into the source directory `cd MovieNight`; - choose your `TARGET` oneof "android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris windows"; - choose your `ARCH` oneof "386 amd64 amd64p32 arm arm64 ppc64 ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32leppc s390 s390x sparc sparc64"; -- build `make TARGET=windows ARCH=386`; +- build `make TARGET=windows ARCH=386` (On BSD systems use `gmake`); - and run `./MovieNight`; Example : ```bash $ git clone https://github.com/zorchenhimer/MovieNight $ cd MovieNight -$ make TARGET=windows ARCH=386 +$ (make|gmake) TARGET=windows ARCH=386 $ ./MovieNight ```