openquell/Makefile
Thomas von Dein dcf31e46ed fixes+changes:
- fixed windows build, using path, instead of path/filepath
- added switch + door, implemented relation (pair_system missing yet)
- fixed ldtk map loading, now using correct entitymap.png tileset
2024-03-28 19:41:20 +01:00

33 lines
940 B
Makefile

version = $(shell egrep "version string = " config/static.go | cut -d'"' -f 2)
BRANCH = $(shell git branch --show-current)
COMMIT = $(shell git rev-parse --short=8 HEAD)
BUILD = $(shell date +%Y.%m.%d.%H%M%S)
#VERSION := $(if $(filter $(BRANCH), development),$(version)-$(BRANCH)-$(COMMIT)-$(BUILD),$(version))
VERSION := $(version)-$(BRANCH)-$(COMMIT)-$(BUILD)
SHORTVERSION := $(version)-$(BRANCH)-$(COMMIT)
LDFLAGS := -ldflags "-X 'openquell/config.VERSION=$(VERSION)'"
all: clean build
@echo ok
clean:
rm -f openquell
build:
go build -ldflags "-X 'openquell/config.VERSION=$(VERSION)'"
buildwasm:
env GOOS=js GOARCH=wasm go build -o openquell.wasm $(LDFLAGS) .
buildwindows:
GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o openquell.exe
zipwasm:
zip -r openquell-$(SHORTVERSION).zip index.html openquell.wasm wasm_exec.js
wasm: buildwasm zipwasm
@ls -l openquell-$(SHORTVERSION).zip
test:
@echo $(VERSION)