summary refs log tree commit diff stats
path: root/Makefile
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-05-26 10:27:22 -0400
committerDrew DeVault <sir@cmpwn.com>2019-05-26 10:27:22 -0400
commitd30a6e3d1f1cf035d018ec27145ef57c4ce41606 (patch)
treed8c892006e3816391c5009eba55f3d8375e616da /Makefile
parent8be4c5715dd7ac0fb79f190c54977db9686f5f95 (diff)
downloadaerc-d30a6e3d1f1cf035d018ec27145ef57c4ce41606.tar.gz
Subsitute prefix in aerc.conf for install
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 17 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 5498a67..09ee192 100644
--- a/Makefile
+++ b/Makefile
@@ -5,12 +5,25 @@ SHAREDIR?=$(_INSTDIR)/share/aerc
 MANDIR?=$(_INSTDIR)/share/man
 GOFLAGS?=
 
-aerc:
+GOSRC := \
+	$(wildcard *.go) \
+	$(wildcard commands/*.go) \
+	$(wildcard config/*.go) \
+	$(wildcard lib/*.go) \
+	$(wildcard ui/*.go) \
+	$(wildcard widgets/*.go) \
+	$(wildcard worker/*.go) \
+	go.mod go.sum
+
+aerc: $(GOSRC)
 	go build $(GOFLAGS) \
 		-ldflags "-X main.Prefix=$(PREFIX)" \
 		-ldflags "-X main.ShareDir=$(SHAREDIR)" \
 		-o $@
 
+aerc.conf: config/aerc.conf.in
+	sed -e 's:@SHAREDIR@:$(SHAREDIR):g' > $@ < $<
+
 %.1: doc/%.1.scd
 	scdoc < $< > $@
 
@@ -29,7 +42,7 @@ DOCS := \
 
 doc: $(DOCS)
 
-all: aerc doc
+all: aerc aerc.conf doc
 
 clean:
 	$(RM) *.1 *.5 *.7 aerc
@@ -44,7 +57,7 @@ install: all
 	install -m644 aerc-smtp.5 $(MANDIR)/man5/aerc-smtp.5
 	install -m644 aerc-tutorial.7 $(MANDIR)/man7/aerc-tutorial.7
 	install -m644 config/accounts.conf $(SHAREDIR)/accounts.conf
-	install -m644 config/aerc.conf $(SHAREDIR)/aerc.conf
+	install -m644 aerc.conf $(SHAREDIR)/aerc.conf
 	install -m644 config/binds.conf $(SHAREDIR)/binds.conf
 	install -m755 contrib/hldiff.py $(SHAREDIR)/filters/hldiff.py
 	install -m755 contrib/html $(SHAREDIR)/filters/html
@@ -52,4 +65,4 @@ install: all
 
 .DEFAULT_GOAL := all
 
-.PHONY: aerc all doc clean install
+.PHONY: all doc clean install