This commit is contained in:
2019-10-31 22:47:36 +03:00
parent cddc5fa70f
commit a91351d3dc
6 changed files with 31 additions and 61 deletions

View File

@ -2,26 +2,27 @@ PROJECT_NAME := "alchemyst-go"
PKG := "lab.zaar.be/thefish/$(PROJECT_NAME)"
GO=$(shell which go)
CWD=$(shell pwd)
DISTFOLDER=$(CWD)/dist
CP=$(shell cp)
GLIDE=$(shell which glide)
LDFLAGS="-X \"main.versionInfo=${PKG_VER}-${CI_PIPELINE_ID} built at $(shell date) on $(shell hostname) with $(shell go version)\""
.PHONY: all build test get-dep
.PHONY: all build test
all: build test
#build: build.spec build.server
build: build.server
build: build.game
#build.spec:
# $(CWD)/bin/oapi-codegen --generate types,spec -o $(CWD)/api/inner/inner.gen.go $(CWD)/public/schema/api.yaml
build.deps:
GIT_SSL_NO_VERIFY=true $(GO) mod vendor
build.server:
$(GO) build -ldflags $(LDFLAGS) -o $(CWD)/bin/game $(CWD)/cmd/game/main.go
build.game:
cp $(CWD)/vendor/lab.zaar.be/thefish/bearlibterminal/libBearLibTerminal.so $(DISTFOLDER)
cp $(CWD)/config.json $(DISTFOLDER)
cp -r $(CWD)/resources $(DISTFOLDER)
$(GO) build -ldflags $(LDFLAGS) -o $(DISTFOLDER)/game $(CWD)/cmd/game/main.go
test:
$(GO) test -v $(go list ./... | grep -v /vendor/)
get-dep:
GIT_SSL_NO_VERIFY=true go mod vendor