1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

Add a Makefile

This patch introduces a Makefile to make it easier to build with version
information, and run all the tests together.

It's just for convenience, plain go commands continue to work just fine.
This commit is contained in:
Alberto Bertogli
2016-10-22 18:36:45 +01:00
parent c87c5ec1bc
commit 60ed30e95a
2 changed files with 45 additions and 0 deletions

40
Makefile Normal file
View File

@@ -0,0 +1,40 @@
ifndef VERSION
VERSION = `git describe --always --long --dirty`
endif
# https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal
ifndef SOURCE_DATE_EPOCH
SOURCE_DATE_EPOCH = `git log -1 --format=%ct`
endif
default: chasquid
all: chasquid chasquid-util smtp-check spf-check
chasquid:
go build -ldflags="\
-X main.version=${VERSION} \
-X main.sourceDateTs=${SOURCE_DATE_EPOCH} \
" ${GOFLAGS}
chasquid-util:
go build ${GOFLAGS} ./cmd/chasquid-util/
smtp-check:
go build ${GOFLAGS} ./cmd/smtp-check/
spf-check:
go build ${GOFLAGS} ./cmd/spf-check/
test:
go test ${GOFLAGS} ./...
setsid -w ./test/run.sh
setsid -w ./cmd/chasquid-util/test.sh
.PHONY: chasquid chasquid-util smtp-check spf-check test