2016-09-02 22:20:54 +00:00
|
|
|
CFLAGS+=-g -O2 -Wall -Wno-switch -Wextra -fstack-protector-strong -D_FORTIFY_SOURCE=2
|
2016-09-05 11:23:58 +00:00
|
|
|
LDLIBS=-lrt
|
2017-05-27 21:51:48 +00:00
|
|
|
|
|
|
|
OS := $(shell uname)
|
|
|
|
|
|
|
|
ifeq ($(OS),OpenBSD)
|
2017-05-27 15:47:05 +00:00
|
|
|
CFLAGS+=-I/usr/local/include -pthread
|
|
|
|
LDLIBS=-L/usr/local/lib -liconv -pthread
|
2016-09-05 12:04:03 +00:00
|
|
|
endif
|
2016-07-11 12:24:04 +00:00
|
|
|
|
2017-05-27 21:51:48 +00:00
|
|
|
ifeq ($(OS),Darwin)
|
|
|
|
LDLIBS=-liconv
|
|
|
|
endif
|
|
|
|
|
2016-08-08 12:16:45 +00:00
|
|
|
DESTDIR=
|
|
|
|
PREFIX=/usr/local
|
|
|
|
BINDIR=$(PREFIX)/bin
|
|
|
|
MANDIR=$(PREFIX)/share/man
|
|
|
|
|
2016-08-19 15:53:40 +00:00
|
|
|
ALL = maddr magrep mdate mdeliver mdirs mexport mflag mgenmid mhdr minc mlist mmime mpick mscan msed mseq mshow msort mthread
|
2017-06-20 12:17:24 +00:00
|
|
|
SCRIPT = mcolor mcom mless mmkdir mquote museragent
|
2016-07-11 12:24:04 +00:00
|
|
|
|
2017-06-01 12:57:01 +00:00
|
|
|
all: $(ALL) museragent
|
2016-07-11 12:24:04 +00:00
|
|
|
|
2016-08-23 15:33:55 +00:00
|
|
|
$(ALL) : % : %.o
|
|
|
|
maddr magrep mdeliver mexport mflag mgenmid mhdr mpick mscan msed mshow \
|
|
|
|
msort mthread : blaze822.o mymemmem.o mytimegm.o
|
2016-12-13 14:21:00 +00:00
|
|
|
maddr magrep mexport mflag mgenmid mhdr mlist mpick mscan msed mseq mshow msort \
|
2016-10-05 12:44:36 +00:00
|
|
|
mthread : seq.o slurp.o
|
2016-08-23 15:33:55 +00:00
|
|
|
maddr magrep mhdr mpick mscan mshow : rfc2047.o
|
|
|
|
magrep mshow : rfc2045.o
|
2017-05-23 13:16:27 +00:00
|
|
|
mshow : filter.o safe_u8putstr.o rfc2231.o pipeto.o
|
2017-05-23 13:25:28 +00:00
|
|
|
mscan : pipeto.o
|
2016-08-23 15:33:55 +00:00
|
|
|
msort : mystrverscmp.o
|
2016-10-05 12:44:36 +00:00
|
|
|
mmime : slurp.o
|
2016-07-11 12:24:04 +00:00
|
|
|
|
2017-06-01 12:57:01 +00:00
|
|
|
museragent: FRC
|
|
|
|
@printf '#!/bin/sh\nprintf "User-Agent: mblaze/%s (%s)\\n"\n' \
|
2017-06-24 14:01:57 +00:00
|
|
|
"$$({ git describe --always --dirty 2>/dev/null || cat VERSION; } | sed 's/^v//')" \
|
2017-06-01 12:57:01 +00:00
|
|
|
"$$(date +%Y-%m-%d)" >$@
|
|
|
|
@chmod +x $@
|
|
|
|
|
2016-08-01 17:33:25 +00:00
|
|
|
README: man/mblaze.7
|
2016-07-25 15:10:21 +00:00
|
|
|
mandoc -Tutf8 $< | col -bx >$@
|
|
|
|
|
2016-07-11 12:24:04 +00:00
|
|
|
clean: FRC
|
2017-06-01 12:57:01 +00:00
|
|
|
-rm -f $(ALL) *.o museragent
|
2016-07-11 12:24:04 +00:00
|
|
|
|
2017-03-30 13:46:47 +00:00
|
|
|
check: FRC all
|
|
|
|
PATH=$$(pwd):$$PATH prove -v
|
|
|
|
|
2016-08-08 12:16:45 +00:00
|
|
|
install: FRC all
|
2016-09-02 22:22:35 +00:00
|
|
|
mkdir -p $(DESTDIR)$(BINDIR) \
|
|
|
|
$(DESTDIR)$(MANDIR)/man1 \
|
2017-06-25 07:14:30 +00:00
|
|
|
$(DESTDIR)$(MANDIR)/man5 \
|
2016-09-02 22:22:35 +00:00
|
|
|
$(DESTDIR)$(MANDIR)/man7
|
2016-08-08 12:16:45 +00:00
|
|
|
install -m0755 $(ALL) $(SCRIPT) $(DESTDIR)$(BINDIR)
|
|
|
|
ln -sf mless $(DESTDIR)$(BINDIR)/mnext
|
|
|
|
ln -sf mless $(DESTDIR)$(BINDIR)/mprev
|
2017-06-18 15:48:24 +00:00
|
|
|
ln -sf mcom $(DESTDIR)$(BINDIR)/mfwd
|
2016-09-02 22:50:25 +00:00
|
|
|
ln -sf mcom $(DESTDIR)$(BINDIR)/mrep
|
2016-09-02 22:22:35 +00:00
|
|
|
install -m0644 man/*.1 $(DESTDIR)$(MANDIR)/man1
|
2017-02-20 14:39:21 +00:00
|
|
|
install -m0644 man/*.5 $(DESTDIR)$(MANDIR)/man5
|
2016-09-02 22:22:35 +00:00
|
|
|
install -m0644 man/*.7 $(DESTDIR)$(MANDIR)/man7
|
2016-08-08 12:16:45 +00:00
|
|
|
|
2017-06-23 17:40:21 +00:00
|
|
|
release:
|
|
|
|
VERSION=$$(git describe --tags | sed 's/^v//;s/-[^.]*$$//') && \
|
|
|
|
git archive --prefix=mblaze-$$VERSION/ -o mblaze-$$VERSION.tar.gz HEAD
|
|
|
|
|
|
|
|
sign:
|
|
|
|
VERSION=$$(git describe --tags | sed 's/^v//;s/-[^.]*$$//') && \
|
|
|
|
gpg --armor --detach-sign mblaze-$$VERSION.tar.gz && \
|
|
|
|
signify -S -s ~/.signify/mblaze.sec -m mblaze-$$VERSION.tar.gz && \
|
|
|
|
sed -i '1cuntrusted comment: verify with mblaze.pub' mblaze-$$VERSION.tar.gz.sig
|
|
|
|
|
2016-07-11 12:24:04 +00:00
|
|
|
FRC:
|