37 lines
1.1 KiB
Makefile
37 lines
1.1 KiB
Makefile
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
|
|
|
|
all: build test
|
|
|
|
#build: build.spec build.server
|
|
build: build.game
|
|
|
|
build.deps:
|
|
GIT_SSL_NO_VERIFY=true $(GO) mod vendor
|
|
|
|
build.game.linux64:
|
|
DISTFOLDER=$(DISTFOLDER)/linux64
|
|
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
|
|
|
|
build.game.win64:
|
|
DISTFOLDER=$(DISTFOLDER)/windows-amd64
|
|
cp $(CWD)/vendor/lab.zaar.be/thefish/bearlibterminal/libBearLibTerminal.so $(DISTFOLDER)
|
|
cp $(CWD)/config.json $(DISTFOLDER)
|
|
cp -r $(CWD)/resources $(DISTFOLDER)
|
|
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ $(GO) build -o $(DISTFOLDER)/game.exe
|
|
|
|
test:
|
|
$(GO) test -v $(go list ./... | grep -v /vendor/)
|