2020-09-22 10:15:18 -04:00
|
|
|
.PHONY: all install build release capdefs test smoke gofmt irctest
|
2017-06-24 15:41:11 -04:00
|
|
|
|
2020-05-21 11:25:30 -04:00
|
|
|
GIT_COMMIT := $(shell git rev-parse HEAD 2> /dev/null)
|
2021-11-03 02:15:46 -04:00
|
|
|
GIT_TAG := $(shell git tag --points-at HEAD 2> /dev/null | head -n 1)
|
2020-05-20 10:31:05 -04:00
|
|
|
|
2022-12-26 02:27:28 -05:00
|
|
|
# disable linking against native libc / libpthread by default;
|
|
|
|
# this can be overridden by passing CGO_ENABLED=1 to make
|
|
|
|
export CGO_ENABLED ?= 0
|
|
|
|
|
2018-06-25 18:08:15 -04:00
|
|
|
capdef_file = ./irc/caps/defs.go
|
|
|
|
|
2023-02-11 21:35:03 -05:00
|
|
|
all: build
|
2017-06-24 15:41:11 -04:00
|
|
|
|
2020-02-12 13:19:23 -05:00
|
|
|
install:
|
2021-11-03 02:15:46 -04:00
|
|
|
go install -v -ldflags "-X main.commit=$(GIT_COMMIT) -X main.version=$(GIT_TAG)"
|
2020-02-09 20:51:23 -05:00
|
|
|
|
2020-02-12 13:19:23 -05:00
|
|
|
build:
|
2021-11-03 02:15:46 -04:00
|
|
|
go build -v -ldflags "-X main.commit=$(GIT_COMMIT) -X main.version=$(GIT_TAG)"
|
2017-07-26 08:04:23 +10:00
|
|
|
|
2020-02-12 13:19:23 -05:00
|
|
|
release:
|
2018-04-11 10:12:28 +10:00
|
|
|
goreleaser --skip-publish --rm-dist
|
|
|
|
|
2018-06-25 18:08:15 -04:00
|
|
|
capdefs:
|
|
|
|
python3 ./gencapdefs.py > ${capdef_file}
|
|
|
|
|
2017-07-26 08:04:23 +10:00
|
|
|
test:
|
2018-06-25 18:08:15 -04:00
|
|
|
python3 ./gencapdefs.py | diff - ${capdef_file}
|
2022-06-16 14:56:28 -04:00
|
|
|
go test ./...
|
|
|
|
go vet ./...
|
2018-05-04 04:27:43 -04:00
|
|
|
./.check-gofmt.sh
|
2020-03-24 09:56:12 -04:00
|
|
|
|
2023-02-11 21:35:03 -05:00
|
|
|
smoke: install
|
2021-05-25 00:34:38 -04:00
|
|
|
ergo mkcerts --conf ./default.yaml || true
|
|
|
|
ergo run --conf ./default.yaml --smoke
|
2020-06-17 02:14:23 -04:00
|
|
|
|
|
|
|
gofmt:
|
|
|
|
./.check-gofmt.sh --fix
|
2020-09-22 10:15:18 -04:00
|
|
|
|
2023-02-11 21:35:03 -05:00
|
|
|
irctest: install
|
2020-09-22 10:15:18 -04:00
|
|
|
git submodule update --init
|
2021-05-26 16:03:32 -04:00
|
|
|
cd irctest && make ergo
|