aerc

Working clone of aerc-mail.org
git clone git://git.danielmoch.com/aerc.git
Log | Files | Refs | README | LICENSE

Makefile (1628B)


      1 .POSIX:
      2 .SUFFIXES:
      3 .SUFFIXES: .1 .5 .7 .1.scd .5.scd .7.scd
      4 VPATH=doc
      5 PREFIX?=/usr/local
      6 _INSTDIR=$(DESTDIR)$(PREFIX)
      7 BINDIR?=$(_INSTDIR)/bin
      8 SHAREDIR?=$(_INSTDIR)/share/aerc
      9 MANDIR?=$(_INSTDIR)/share/man
     10 GOFLAGS?=
     11 
     12 GOSRC!=find . -name '*.go'
     13 GOSRC+=go.mod go.sum
     14 
     15 aerc: $(GOSRC)
     16 	go build $(GOFLAGS) \
     17 		-ldflags "-X main.Prefix=$(PREFIX)" \
     18 		-ldflags "-X main.ShareDir=$(SHAREDIR)" \
     19 		-o $@
     20 
     21 aerc.conf: config/aerc.conf.in
     22 	sed -e 's:@SHAREDIR@:$(SHAREDIR):g' > $@ < config/aerc.conf.in
     23 
     24 DOCS := \
     25 	aerc.1 \
     26 	aerc-config.5 \
     27 	aerc-imap.5 \
     28 	aerc-smtp.5 \
     29 	aerc-tutorial.7
     30 
     31 .1.scd.1:
     32 	scdoc < $< > $@
     33 
     34 .5.scd.5:
     35 	scdoc < $< > $@
     36 
     37 .7.scd.7:
     38 	scdoc < $< > $@
     39 
     40 doc: $(DOCS)
     41 
     42 all: aerc aerc.conf doc
     43 
     44 # Exists in GNUMake but not in NetBSD make and others.
     45 RM?=rm -f
     46 
     47 clean:
     48 	$(RM) $(DOCS) aerc.conf aerc
     49 
     50 install: all
     51 	mkdir -p $(BINDIR) $(MANDIR)/man1 $(MANDIR)/man5 $(MANDIR)/man7 \
     52 		$(SHAREDIR) $(SHAREDIR)/filters
     53 	install -m755 aerc $(BINDIR)/aerc
     54 	install -m644 aerc.1 $(MANDIR)/man1/aerc.1
     55 	install -m644 aerc-config.5 $(MANDIR)/man5/aerc-config.5
     56 	install -m644 aerc-imap.5 $(MANDIR)/man5/aerc-imap.5
     57 	install -m644 aerc-smtp.5 $(MANDIR)/man5/aerc-smtp.5
     58 	install -m644 aerc-tutorial.7 $(MANDIR)/man7/aerc-tutorial.7
     59 	install -m644 config/accounts.conf $(SHAREDIR)/accounts.conf
     60 	install -m644 aerc.conf $(SHAREDIR)/aerc.conf
     61 	install -m644 config/binds.conf $(SHAREDIR)/binds.conf
     62 	install -m755 contrib/hldiff.py $(SHAREDIR)/filters/hldiff.py
     63 	install -m755 contrib/html $(SHAREDIR)/filters/html
     64 	install -m755 contrib/plaintext.py $(SHAREDIR)/filters/plaintext.py
     65 
     66 .DEFAULT_GOAL := all
     67 
     68 .PHONY: all doc clean install