summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorTobias Wiese <tobias@tobiaswiese.com>2020-08-07 17:42:13 +0200
committerTobias Wiese <tobias@tobiaswiese.com>2020-08-07 17:42:13 +0200
commit94aca244aa2de4cc9b7728f2c64d3a6add1b9efa (patch)
tree74141122a14e9a9bd5b9d97da271e4b7317b4429 /Makefile
parente1cfd1c7d296cd691d2194187575f3302f66ef92 (diff)
manpage for exchange.1
Add a manpage for exchage. This manual page is installed with the install and removed with the uninstall target. Signed-off-by: Tobias Wiese <tobias@tobiaswiese.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 11 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 341cd46..915330f 100644
--- a/Makefile
+++ b/Makefile
@@ -22,24 +22,32 @@ TARGETS := exchange
MAINS := $(addsuffix .o, $(TARGETS))
OBJ := $(MAINS)
+MAN1 := exchange.1
+MAN1_GZ := $(addsuffix .gz, $(MAN1))
+
.PHONY: all
-all: $(TARGETS)
+all: $(TARGETS) $(MAN1_GZ)
.PHONY: clean
clean:
- rm -f $(OBJ) $(TARGETS)
+ rm -f $(OBJ) $(TARGETS) $(MAN1_GZ)
.PHONY: distclean
distclean: clean
.PHONY: install
-install: $(TARGETS)
+install: $(TARGETS) $(MAN1_GZ)
$(INSTALL) -Dt "$(DESTDIR)$(prefix)/bin" $(TARGETS)
+ $(INSTALL) -Dt "$(DESTDIR)$(prefix)/share/man/man1" $(MAN1_GZ)
.PHONY: uninstall
uninstall:
cd $(DESTDIR)$(prefix)/bin && rm -f $(TARGETS)
+ cd $(DESTDIR)$(prefix)/share/man/man1 && rm -f $(MAN1_GZ)
$(TARGETS): % : %.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+$(MAN1_GZ): %.gz : %
+ gzip -9 -k -f $^