mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-07-30 02:49:49 +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:
@@ -9,7 +9,12 @@
|
||||
|
||||
# The binaries.
|
||||
chasquid
|
||||
chasquid-util
|
||||
smtp-check
|
||||
spf-check
|
||||
cmd/chasquid-util/chasquid-util
|
||||
cmd/smtp-check/smtp-check
|
||||
cmd/spf-check/spf-check
|
||||
|
||||
# Exclude any .pem files, to prevent accidentally including test keys and
|
||||
# certificates.
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user