small pixel drawing of a pufferfish clist

Simplify makefile, add makefile config, fix tests
j3s j3s@cyberia.club
Mon, 25 Nov 2019 10:55:56 -0600
commit

7a89207f129f2ce2442bc80cddc8fe4db5d667b5

parent

e7cd5ca32d1a700304ec3bbd648c16bd077fe993

3 files changed, 24 insertions(+), 22 deletions(-)

jump to
M MakefileMakefile

@@ -1,29 +1,25 @@

+# clist - simple mailing list .POSIX: -VERSION=0.1.0 +include config.mk -PREFIX?=/usr/local -_INSTDIR=$(DESTDIR)$(PREFIX) -BINDIR?=$(_INSTDIR)/bin -GO?=go -GOFLAGS?= +all: options clean clist -GOSRC!=find . -name '*.go' -GOSRC+=go.mod go.sum - -clist: $(GOSRC) - $(GO) build $(GOFLAGS) \ - -ldflags "-X main.Prefix=$(PREFIX) \ - -X main.ShareDir=$(SHAREDIR) \ - -X main.Version=$(VERSION)" \ - -o $@ +options: + @echo clist build options: + @echo "VERSION = $(VERSION)" + @echo "PREFIX = $(PREFIX)" -all: clist +clean: + rm -f clist -# Exists in GNUMake but not in NetBSD make and others. -RM?=rm -f +clist: + go build -o clist -v -clean: - $(RM) aerc +install: clist + mkdir -p $(DESTDIR)$(PREFIX)/bin + cp -f clist $(DESTDIR)$(PREFIX)/bin + chmod 755 $(DESTDIR)$(PREFIX)/bin/clist -.DEFAULT_GOAL := all +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/clist
A config.mk

@@ -0,0 +1,6 @@

+# clist version +VERSION = 0.1.0 + +# paths +PREFIX ?= /usr/local +MANPREFIX = $(PREFIX)/share/man
M main.gomain.go

@@ -96,10 +96,10 @@ for _, l := range gConfig.Lists {

agg := append(msg.To, msg.Cc...) if checkAddress(agg, l.Address) { matchedLists = append(matchedLists, l) + log.Printf("matched list: %q", l.Address) } } - log.Printf("matchedLists: %q", matchedLists) if len(matchedLists) == 1 { list := matchedLists[0] if list.CanPost(msg.From[0]) {