summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKylie McClain <kylie@somasis.com>2017-11-17 23:10:08 -0500
committerKylie McClain <kylie@somasis.com>2017-11-19 01:53:40 -0500
commit3e1a4df3fb7c761cfb5d16f1a823ae52877a0de2 (patch)
tree1e6ee3abf42415e78ece5d2dd0e1c8a893b81803 /src
parentab390a02dc415d7a9d1cfe999cd7ddc683e6aef8 (diff)
Makefile: Add ability to disable compressing manpage
Some distributions don't compress them.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/Makefile b/src/Makefile
index 50dc32b5..bd1f259f 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,5 +1,12 @@
debug ?= yes
static ?= no
+gzip_man ?= yes
+
+ifneq ($(gzip_man),yes)
+ ifneq ($(gzip_man),no)
+ $(error gzip_man should be either yes or no)
+ endif
+endif
ifeq ($(debug),yes)
CPPFLAGS += -DKAK_DEBUG
@@ -73,9 +80,16 @@ kak$(suffix) : $(objects)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -MD -MP -MF $(addprefix ., $(<:.cc=$(suffix).d)) -c -o $@ $<
# Generate the man page
+ifeq ($(gzip_man),yes)
../doc/kak.1.gz: ../doc/kak.1.txt
a2x --no-xmllint -f manpage $<
gzip -n -9 -f $(basename $<)
+man: ../doc/kak.1.gz
+else
+../doc/kak.1: ../doc/kak.1.txt
+ a2x --no-xmllint -f manpage $<
+man: ../doc/kak.1
+endif
check: test
test:
@@ -84,14 +98,13 @@ test:
TAGS: tags
tags:
ctags -R
-man: ../doc/kak.1.gz
clean:
rm -f .*.o .*.d
distclean: clean
rm -f kak kak$(suffix)
- find ../doc -type f -name \*\\.gz -exec rm -f '{}' +
+ find ../doc -type f \( -name \*\\.gz -o -name \*\\.1 \) -exec rm -f '{}' +
installdirs:
install -d $(bindir) \
@@ -113,7 +126,11 @@ install: kak man installdirs
[ -e $(sharedir)/autoload ] || ln -s rc $(sharedir)/autoload
install -m 0644 ../colors/* $(sharedir)/colors
install -m 0644 ../README.asciidoc $(docdir)
+ifeq ($(gzip_man),yes)
install -m 0644 ../doc/kak.1.gz $(mandir)
+else
+ install -m 0644 ../doc/kak.1 $(mandir)
+endif
install-strip: install
strip -s $(bindir)/kak
@@ -122,7 +139,8 @@ uninstall:
rm -rf $(bindir)/kak \
$(sharedir) \
$(docdir) \
- $(mandir)/kak.1.gz
+ $(mandir)/kak.1.gz \
+ $(mandir)/kak.1
.PHONY: check TAGS clean distclean installdirs install install-strip uninstall
.PHONY: tags test man kak