0
Files
aleesa-jabber-go/Makefile
2023-09-17 12:18:09 +03:00

45 lines
871 B
Makefile

#!/usr/bin/env gmake -f
BUILDOPTS=-ldflags="-s -w" -a -gcflags=all=-l -trimpath
FILELIST=collection.go types.go globals.go lib.go event_parser.go commands.go redis.go settings-db-util.go main.go
BINARY=aleesa-jabber-go
all: clean build
build:
ifeq ($(OS),Windows_NT)
# powershell
ifeq ($(SHELL),sh.exe)
SET CGO_ENABLED=0
go build ${BUILDOPTS} -o ${BINARY} ${FILELIST}
else
# jetbrains golang
CGO_ENABLED=0
go build ${BUILDOPTS} -o ${BINARY} ${FILELIST}
endif
# bash/git bash
else
CGO_ENABLED=0 go build ${BUILDOPTS} -o ${BINARY} ${FILELIST}
endif
clean:
go clean
upgrade:
ifeq ($(OS),Windows_NT)
# jetbrains golang, powershell
ifeq ($(SHELL),sh.exe)
if exist vendor del /F /S /Q vendor >nul
# git bash case
else
$(RM) -r vendor
endif
else
$(RM) -r vendor
endif
go get -d -u -t ./...
go mod tidy
go mod vendor
# vim: set ft=make noet ai ts=4 sw=4 sts=4: