]> git.tuebingen.mpg.de Git - dss.git/commitdiff
build: Compress the man page.
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 28 Apr 2024 03:07:01 +0000 (05:07 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 20 May 2024 18:22:53 +0000 (20:22 +0200)
Run gzip with -n to make the build reproducible.

.gitignore
Makefile

index b6dcfd23a6d2e4c6795159e0a4a830d4cce54cc7..fc6a8bb8dea359847f299ddb6fcb9afa9e750c13 100644 (file)
@@ -5,6 +5,6 @@ version.c
 *.swp
 dss.lsg.*
 dss
-dss.1
+dss.1.gz
 dss.1.html
 index.html
index 59826407f57db1ade187a07b8fbb7a46344c2f04..eaf3e540f4c08885de9f82c456f11bc1121a6ea6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,13 +8,14 @@ VERSION := $(shell ./version-gen.sh dss version.c)
 RM := rm -f
 LSG := lopsubgen
 GROFF := groff -m man -Thtml -P -l -P -r
+GZIP := gzip -cfn9
 
 units := dss str file exec sig daemon df tv snap ipc dss.lsg version
 objs := $(addsuffix .o, $(units))
 deps := $(addsuffix .d, $(units))
 
-all: dss dss.1
-man: dss.1
+all: dss dss.1.gz
+man: dss.1.gz
 $(objs): dss.lsg.h Makefile
 -include $(deps)
 
@@ -60,12 +61,15 @@ dss: $(objs)
 %.1: %.suite
        $(call SAY, LSGM $<)
        $(LSG) --gen-man=$@ --version-string=$(VERSION) < $<
+%.1.gz: %.1
+       $(call SAY, GZIP $<)
+       $(GZIP) < $< > $@
 %.1.html: %.1
        $(call SAY, GROFF $<)
        $(GROFF) $< | sed -e '1,/^<body>/d; /^<\/body>/,$$d' > $@
 clean:
        $(call SAY, CLEAN)
-       $(RM) *.[od] dss dss.1 *.html dss.lsg.[ch] version.c
+       $(RM) *.[od] dss dss.1.* *.html dss.lsg.[ch] version.c
 
 ifneq ($(findstring strip, $(MAKECMDGOALS)),)
        strip_option := -s
@@ -75,7 +79,7 @@ mandir := $(DESTDIR)$(PREFIX)/share/man/man1
 install install-strip: all
        $(MKDIR_P) $(bindir) $(mandir)
        $(INSTALL_PROGRAM) $(strip_option) dss $(bindir)
-       $(INSTALL_DATA) dss.1 $(mandir)
+       $(INSTALL_DATA) dss.1.gz $(mandir)
 
 index.html: dss.1.html index.html.in INSTALL README NEWS
        sed -e '/@README@/,$$d' index.html.in > $@