2021-07-22 18:19:21 -04:00
|
|
|
GAMEFILES=$(wildcard internal/game/*.go)
|
|
|
|
COORDFILEs=$(wildcard internal/coordinator/*.go)
|
2021-07-16 14:08:19 -04:00
|
|
|
#set variables
|
|
|
|
GIT_COMMIT := $(shell git rev-list -1 HEAD)
|
|
|
|
ifeq ($(PREFIX),) # PREFIX is environment variable, but if it is not set, then set default value
|
|
|
|
PREFIX := /usr/local
|
|
|
|
endif
|
|
|
|
|
2021-07-29 14:48:36 -04:00
|
|
|
all: client client2 server engine
|
2021-07-23 12:10:49 -04:00
|
|
|
|
2021-07-22 18:19:21 -04:00
|
|
|
client: $(GAMEFILES) $(wildcard cmd/client/*.go)
|
|
|
|
go build -ldflags "-X main.GitCommit=$(GIT_COMMIT)" ./cmd/client
|
2021-07-29 14:48:36 -04:00
|
|
|
client2: $(GAMEFILES) $(wildcard cmd/client2/*.go)
|
|
|
|
go build -ldflags "-X main.GitCommit=$(GIT_COMMIT)" ./cmd/client2
|
2021-07-23 16:43:39 -04:00
|
|
|
server: $(GAMEFILES) $(COORDFILEs) $(wildcard cmd/server/*.go)
|
2021-07-22 18:19:21 -04:00
|
|
|
go build -ldflags "-X main.GitCommit=$(GIT_COMMIT)" ./cmd/server
|
|
|
|
engine: $(GAMEFILES)
|
|
|
|
go build -ldflags "-X main.GitCommit=$(GIT_COMMIT)" ./cmd/engine
|
2021-07-16 14:08:19 -04:00
|
|
|
|
|
|
|
clean:
|
2021-07-22 18:19:21 -04:00
|
|
|
rm -f client server engine
|
|
|
|
run: engine
|
|
|
|
./engine
|
2021-07-16 14:08:19 -04:00
|
|
|
install: $(SNENGAME)
|
|
|
|
install -d $(DESTDIR)$(PREFIX)/bin
|
|
|
|
install -m 755 $(PROG) $(DESTDIR)$(PREFIX)/bin
|
|
|
|
|