mblaze/GNUmakefile

81 lines
2.4 KiB
Makefile
Raw Normal View History

CFLAGS?=-g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2
override CFLAGS:=-Wall -Wno-switch -Wextra $(CFLAGS)
LDLIBS=-lrt
2017-05-27 21:51:48 +00:00
OS := $(shell uname)
ifeq ($(OS),OpenBSD)
LOCALBASE=/usr/local
override CFLAGS+=-I$(LOCALBASE)/include -pthread
LDLIBS=-L$(LOCALBASE)/lib -liconv -pthread
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
2017-07-26 15:23:01 +00:00
ALL = maddr magrep mdate mdeliver mdirs mexport mflag mflow 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
$(ALL) : % : %.o
2017-07-26 15:23:01 +00:00
maddr magrep mdeliver mexport mflag mflow mgenmid mhdr mpick mscan msed mshow \
msort mthread : blaze822.o mymemmem.o mytimegm.o
2018-04-17 13:15:31 +00:00
maddr magrep mdeliver mexport mflag mgenmid mhdr mlist mpick mscan msed mseq \
2019-01-10 15:43:25 +00:00
mshow msort mthread : seq.o slurp.o mystrverscmp.o
2017-07-26 15:23:01 +00:00
maddr magrep mflow mhdr mpick mscan mshow : rfc2047.o
magrep mflow mhdr mshow : rfc2045.o
mshow : filter.o safe_u8putstr.o rfc2231.o pipeto.o
mscan : pipeto.o
mmime : slurp.o
2017-07-12 20:31:35 +00:00
minc mlist : squeeze_slash.o
2016-07-11 12:24:04 +00:00
2017-06-01 12:57:01 +00:00
museragent: FRC
@test -n "$$SOURCE_DATE_EPOCH" || BUILDDATE=$$(date '+ (%Y-%m-%d)'); \
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//')" \
"$$BUILDDATE" >$@
2017-06-01 12:57:01 +00:00
@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
mkdir -p $(DESTDIR)$(BINDIR) \
$(DESTDIR)$(MANDIR)/man1 \
$(DESTDIR)$(MANDIR)/man5 \
$(DESTDIR)$(MANDIR)/man7
2016-08-08 12:16:45 +00:00
install -m0755 $(ALL) $(SCRIPT) $(DESTDIR)$(BINDIR)
2018-01-06 18:17:49 +00:00
ln -sf mcom $(DESTDIR)$(BINDIR)/mbnc
ln -sf mcom $(DESTDIR)$(BINDIR)/mfwd
ln -sf mcom $(DESTDIR)$(BINDIR)/mrep
2018-04-17 13:15:31 +00:00
ln -sf mdeliver $(DESTDIR)$(BINDIR)/mrefile
install -m0644 man/*.1 $(DESTDIR)$(MANDIR)/man1
2017-02-20 14:39:21 +00:00
install -m0644 man/*.5 $(DESTDIR)$(MANDIR)/man5
install -m0644 man/*.7 $(DESTDIR)$(MANDIR)/man7
2016-08-08 12:16:45 +00:00
release:
VERSION=$$(git describe --tags | sed 's/^v//;s/-[^.]*$$//') && \
[ "$$VERSION" = "$$(cat VERSION)" ] && \
git archive --prefix=mblaze-$$VERSION/ -o mblaze-$$VERSION.tar.gz HEAD
sign:
VERSION=$$(git describe --tags | sed 's/^v//;s/-[^.]*$$//') && \
2020-01-18 15:36:35 +00:00
gpg2 --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: