Install man pages in compressed form.
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 21 May 2019 09:54:25 +0000 (11:54 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 24 May 2019 06:32:00 +0000 (08:32 +0200)
This is generally a good idea since all versions of man(1) support
at least gzip-compressed manual pages.

.gitignore
Makefile

index c2b3735eaccdcf78e72dc8030a025356859ae8ec..f1c16e830fd4db9dd441f0dcb32de7a85a756a88 100644 (file)
@@ -7,7 +7,7 @@ config.mak
 config.log
 config.status
 configure.sh
-*.6
+*.6.gz
 *.lsg.*
 *.flex.*
 *.bison.*
index d81133a6db5ce52354ed04e0e92ae1c4298c9ada..b0cd34d22a5f032703deff50c68de3bcf2933f4f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,7 @@ MAKEFLAGS += -Rr
 RM := rm -f
 MKDIR_P := mkdir -p
 CHMOD := chmod
+GZIP := gzip -f9
 
 ifeq ("$(origin CC)", "default")
         CC := cc
@@ -57,7 +58,7 @@ cc_version := $(shell $(CC) --version | head -n 1)
 build_date := $(shell date)
 uname_rs := $(shell uname -rs)
 
-all := tfortune tfortune.6
+all := tfortune tfortune.6.gz
 all: $(all)
 
 deps := txp.bison.d txp.flex.d ast.d tfortune.d util.d txp.flex.d \
@@ -116,9 +117,10 @@ index.html tfortune.suite: %: %.m4
        $(call SAY, LSGH $<)
        $(LOPSUBGEN) --gen-header < $<
 
-%.6: %.suite version.c
+%.6.gz: %.suite version.c
        $(call SAY, LSGM $<)
-       $(LOPSUBGEN) --gen-man=$@ --version-string $(GIT_VERSION) < $<
+       $(LOPSUBGEN) --gen-man=${@:.gz=} --version-string $(GIT_VERSION) < $<
+       $(GZIP) ${@:.gz=}
 
 %.flex.c: %.lex
        $(call SAY, FLEX $<)
@@ -182,7 +184,7 @@ tfortune: $(deps:.d=.o)
 mostlyclean:
        $(RM) tfortune *.o *.d
 clean: mostlyclean
-       $(RM) *.lsg.* *.flex.* *.bison.* *.6 *.suite
+       $(RM) *.lsg.* *.flex.* *.bison.* *.6.gz *.suite
 distclean: clean
        $(RM) config.mak config.status config.log config.h config.h.in version.c
        $(RM) -r autom4te.cache
@@ -200,7 +202,7 @@ endif
 install install-strip: all
        $(MKDIR_P) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)
        $(INSTALL_PROGRAM) $(strip_option) tfortune $(DESTDIR)$(bindir)
-       $(INSTALL_DATA) tfortune.6 $(DESTDIR)$(mandir)
+       $(INSTALL_DATA) tfortune.6.gz $(DESTDIR)$(mandir)
 
 define README :=
 tfortune - $(SLOGAN)
@@ -221,8 +223,8 @@ Resources
 
 Documentation
 ~~~~~~~~~~~~~
-See tfortune.suite. Or build the man page with \"make tfortune.6\"
-and run \"man -l tfortune.6\".
+See tfortune.suite. Or build the man page with \"make tfortune.6.gz\"
+and run \"man -l tfortune.6.gz\".
 
 Dependencies
 ~~~~~~~~~~~~