File: Makefile

package info (click to toggle)
chasquid 1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,672 kB
  • sloc: sh: 1,040; python: 286; makefile: 71
file content (63 lines) | stat: -rw-r--r-- 1,397 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

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 mda-lmtp dovecot-auth-cli


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/

mda-lmtp:
	go build ${GOFLAGS} ./cmd/mda-lmtp/

dovecot-auth-cli:
	go build ${GOFLAGS} ./cmd/dovecot-auth-cli/

test:
	go test ${GOFLAGS} ./...
	setsid -w ./test/run.sh
	setsid -w ./test/stress.sh
	setsid -w ./cmd/chasquid-util/test.sh
	setsid -w ./cmd/mda-lmtp/test.sh
	setsid -w ./cmd/dovecot-auth-cli/test.sh


install-binaries: chasquid chasquid-util smtp-check mda-lmtp
	mkdir -p /usr/local/bin/
	cp -a chasquid chasquid-util smtp-check mda-lmtp /usr/local/bin/

install-config-skeleton:
	if ! [ -d /etc/chasquid ] ; then cp -arv etc / ; fi
	
	if ! [ -d /var/lib/chasquid ]; then \
		mkdir -v /var/lib/chasquid; \
		chmod -v 0700 /var/lib/chasquid ; \
		chown -v mail:mail /var/lib/chasquid ; \
	fi


.PHONY: chasquid test \
	chasquid-util smtp-check spf-check mda-lmtp dovecot-auth-cli