snengame/Makefile

27 lines
844 B
Makefile
Raw Normal View History

2021-07-22 18:19:21 -04:00
GAMEFILES=$(wildcard internal/game/*.go)
COORDFILEs=$(wildcard internal/coordinator/*.go)
PROG=snengame
#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
$(PROG): $(GOFILES)
go build -ldflags "-X main.GitCommit=$(GIT_COMMIT)"
2021-07-22 18:19:21 -04:00
client: $(GAMEFILES) $(wildcard cmd/client/*.go)
go build -ldflags "-X main.GitCommit=$(GIT_COMMIT)" ./cmd/client
server: $(GAMEFILES) $(wildcard cmd/server/*.go)
go build -ldflags "-X main.GitCommit=$(GIT_COMMIT)" ./cmd/server
engine: $(GAMEFILES)
go build -ldflags "-X main.GitCommit=$(GIT_COMMIT)" ./cmd/engine
clean:
2021-07-22 18:19:21 -04:00
rm -f client server engine
run: engine
./engine
install: $(SNENGAME)
install -d $(DESTDIR)$(PREFIX)/bin
install -m 755 $(PROG) $(DESTDIR)$(PREFIX)/bin