aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-01-21 20:56:24 +0100
committerRobin Jarry <robin@jarry.cc>2022-01-21 21:56:40 +0100
commite97e0d8ab188bd4fdc04ee4156b17c2e1c26c124 (patch)
treec76bfc85d9825a58902ec25c53a258694fc3ece1
parent34d36bad0de1f4ba98a68abb3a109c992aede324 (diff)
downloadaerc-e97e0d8ab188bd4fdc04ee4156b17c2e1c26c124.tar.gz
aerc-e97e0d8ab188bd4fdc04ee4156b17c2e1c26c124.zip
mk: be compatible with bsd make
ifeq is not supported by bsd make. We don't need this. Use a simple shell command. Signed-off-by: Robin Jarry <robin@jarry.cc>
-rw-r--r--Makefile42
1 files changed, 17 insertions, 25 deletions
diff --git a/Makefile b/Makefile
index 16bdac41..a56ca086 100644
--- a/Makefile
+++ b/Makefile
@@ -2,13 +2,7 @@
.SUFFIXES:
.SUFFIXES: .1 .5 .7 .1.scd .5.scd .7.scd
-_git_version=$(shell git describe --long --tags --dirty 2>/dev/null | sed 's/-/.r/;s/-/./')
-ifeq ($(strip $(_git_version)),)
-VERSION=0.7.1
-else
-VERSION=$(_git_version)
-endif
-
+VERSION?=`git describe --long --tags --dirty 2>/dev/null || echo 0.7.1`
VPATH=doc
PREFIX?=/usr/local
BINDIR?=$(PREFIX)/bin
@@ -20,6 +14,21 @@ GOFLAGS?=
GOSRC:=$(shell find * -name '*.go')
GOSRC+=go.mod go.sum
+DOCS := \
+ aerc.1 \
+ aerc-search.1 \
+ aerc-config.5 \
+ aerc-imap.5 \
+ aerc-maildir.5 \
+ aerc-sendmail.5 \
+ aerc-notmuch.5 \
+ aerc-smtp.5 \
+ aerc-tutorial.7 \
+ aerc-templates.7 \
+ aerc-stylesets.7
+
+all: aerc aerc.conf $(DOCS)
+
aerc: $(GOSRC)
$(GO) build $(GOFLAGS) \
-ldflags "-X main.Prefix=$(PREFIX) \
@@ -46,19 +55,6 @@ debug: $(GOSRC)
GOFLAGS="-tags=notmuch" \
dlv debug --headless --listen localhost:4747 &>/dev/null
-DOCS := \
- aerc.1 \
- aerc-search.1 \
- aerc-config.5 \
- aerc-imap.5 \
- aerc-maildir.5 \
- aerc-sendmail.5 \
- aerc-notmuch.5 \
- aerc-smtp.5 \
- aerc-tutorial.7 \
- aerc-templates.7 \
- aerc-stylesets.7
-
.1.scd.1:
scdoc < $< > $@
@@ -70,15 +66,13 @@ DOCS := \
doc: $(DOCS)
-all: aerc aerc.conf doc
-
# Exists in GNUMake but not in NetBSD make and others.
RM?=rm -f
clean:
$(RM) $(DOCS) aerc.conf aerc
-install: all
+install: $(DOCS) aerc aerc.conf
mkdir -m755 -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1 $(DESTDIR)$(MANDIR)/man5 $(DESTDIR)$(MANDIR)/man7 \
$(DESTDIR)$(SHAREDIR) $(DESTDIR)$(SHAREDIR)/filters $(DESTDIR)$(SHAREDIR)/templates $(DESTDIR)$(SHAREDIR)/stylesets
install -m755 aerc $(DESTDIR)$(BINDIR)/aerc
@@ -129,6 +123,4 @@ uninstall:
$(RMDIR_IF_EMPTY) $(DESTDIR)$(MANDIR)/man7
$(RMDIR_IF_EMPTY) $(DESTDIR)$(MANDIR)
-.DEFAULT_GOAL := all
-
.PHONY: all doc clean install uninstall debug