From: John Kacur <jkacur@redhat.com>
To: Kurt Kanzenbach <kurt@linutronix.de>
Cc: Clark Williams <williams@redhat.com>,
rt-users <linux-rt-users@vger.kernel.org>
Subject: Re: [PATCH] make: Make man page compression configurable
Date: Thu, 30 Jan 2020 14:45:33 -0500 (EST) [thread overview]
Message-ID: <alpine.LFD.2.21.2001301444460.6499@planxty> (raw)
In-Reply-To: <20200130082949.9647-1-kurt@linutronix.de>
On Thu, 30 Jan 2020, Kurt Kanzenbach wrote:
> Currently the man pages are unconditionally gzip compressed. However, users
> might want to use something else such as bzip2 or none.
>
> When using package management systems it makes sense to use no compression at
> all, as the package system might chose the appropriate one. Therefore, introduce
> MAN_COMPRESSION. This variable is handling how the compression is done. Default
> is gzip.
>
> Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
> ---
> Makefile | 60 ++++++++++++++++++++++++++++++++++++++------------------
> 1 file changed, 41 insertions(+), 19 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index e2142ba3f4e9..ecbd5b1cb98b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -34,6 +34,32 @@ LDFLAGS ?=
>
> PYLIB ?= $(shell python3 -c 'import distutils.sysconfig; print (distutils.sysconfig.get_python_lib())')
>
> +MANPAGES = src/cyclictest/cyclictest.8 \
> + src/pi_tests/pi_stress.8 \
> + src/ptsematest/ptsematest.8 \
> + src/rt-migrate-test/rt-migrate-test.8 \
> + src/sigwaittest/sigwaittest.8 \
> + src/svsematest/svsematest.8 \
> + src/pmqtest/pmqtest.8 \
> + src/hackbench/hackbench.8 \
> + src/signaltest/signaltest.8 \
> + src/pi_tests/pip_stress.8 \
> + src/queuelat/queuelat.8 \
> + src/sched_deadline/deadline_test.8 \
> + src/ssdd/ssdd.8 \
> + src/sched_deadline/cyclicdeadline.8
> +
> +ifdef PYLIB
> + MANPAGES += src/hwlatdetect/hwlatdetect.8
> +endif
> +
> +MAN_COMPRESSION ?= gzip
> +ifeq ($(MAN_COMPRESSION),gzip)
> + MANPAGES := $(MANPAGES:.8=.8.gz)
> +else ifeq ($(MAN_COMPRESSION),bzip2)
> + MANPAGES := $(MANPAGES:.8=.8.bz2)
> +endif
> +
> ifndef DEBUG
> CFLAGS += -O2 -g
> else
> @@ -150,11 +176,17 @@ queuelat: $(OBJDIR)/queuelat.o $(OBJDIR)/librttest.a
> ssdd: $(OBJDIR)/ssdd.o $(OBJDIR)/librttest.a
> $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB)
>
> +%.8.gz: %.8
> + gzip -c $< > $@
> +
> +%.8.bz2: %.8
> + bzip2 -c $< > $@
> +
> LIBOBJS =$(addprefix $(OBJDIR)/,error.o rt-get_cpu.o rt-sched.o rt-utils.o)
> $(OBJDIR)/librttest.a: $(LIBOBJS)
> $(AR) rcs $@ $^
>
> -CLEANUP = $(TARGETS) *.o .depend *.*~ *.orig *.rej *.d *.a
> +CLEANUP = $(TARGETS) *.o .depend *.*~ *.orig *.rej *.d *.a *.8.gz *.8.bz2
> CLEANUP += $(if $(wildcard .git), ChangeLog)
>
> .PHONY: clean
> @@ -175,36 +207,26 @@ rebuild:
> $(MAKE) all
>
> .PHONY: install
> -install: all install_hwlatdetect
> - mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man8"
> +install: all install_manpages install_hwlatdetect
> + mkdir -p "$(DESTDIR)$(bindir)"
> cp $(TARGETS) "$(DESTDIR)$(bindir)"
> install src/queuelat/get_cpuinfo_mhz.sh "$(DESTDIR)$(bindir)"
> install src/queuelat/determine_maximum_mpps.sh "${DESTDIR}${bindir}"
> - gzip -c src/cyclictest/cyclictest.8 >"$(DESTDIR)$(mandir)/man8/cyclictest.8.gz"
> - gzip -c src/pi_tests/pi_stress.8 >"$(DESTDIR)$(mandir)/man8/pi_stress.8.gz"
> - gzip -c src/ptsematest/ptsematest.8 >"$(DESTDIR)$(mandir)/man8/ptsematest.8.gz"
> - gzip -c src/rt-migrate-test/rt-migrate-test.8 >"$(DESTDIR)$(mandir)/man8/rt-migrate-test.8.gz"
> - gzip -c src/sigwaittest/sigwaittest.8 >"$(DESTDIR)$(mandir)/man8/sigwaittest.8.gz"
> - gzip -c src/svsematest/svsematest.8 >"$(DESTDIR)$(mandir)/man8/svsematest.8.gz"
> - gzip -c src/pmqtest/pmqtest.8 >"$(DESTDIR)$(mandir)/man8/pmqtest.8.gz"
> - gzip -c src/hackbench/hackbench.8 >"$(DESTDIR)$(mandir)/man8/hackbench.8.gz"
> - gzip -c src/signaltest/signaltest.8 >"$(DESTDIR)$(mandir)/man8/signaltest.8.gz"
> - gzip -c src/pi_tests/pip_stress.8 >"$(DESTDIR)$(mandir)/man8/pip_stress.8.gz"
> - gzip -c src/queuelat/queuelat.8 >"$(DESTDIR)$(mandir)/man8/queuelat.8.gz"
> - gzip -c src/sched_deadline/deadline_test.8 >"$(DESTDIR)$(mandir)/man8/deadline_test.8.gz"
> - gzip -c src/ssdd/ssdd.8 >"$(DESTDIR)$(mandir)/man8/ssdd.8.gz"
> - gzip -c src/sched_deadline/cyclicdeadline.8 >"$(DESTDIR)$(mandir)/man8/cyclicdeadline.8.gz"
>
> .PHONY: install_hwlatdetect
> install_hwlatdetect: hwlatdetect
> if test -n "$(PYLIB)" ; then \
> - mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man8" ; \
> + mkdir -p "$(DESTDIR)$(bindir)" ; \
> install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
> rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
> ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
> - gzip -c src/hwlatdetect/hwlatdetect.8 >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz" ; \
> fi
>
> +.PHONY: install_manpages
> +install_manpages: $(MANPAGES)
> + mkdir -p "$(DESTDIR)$(mandir)/man8"
> + cp $(MANPAGES) "$(DESTDIR)$(mandir)/man8"
> +
> .PHONY: tarball
> tarball:
> git archive --worktree-attributes --prefix=rt-tests-${VERSION}/ -o rt-tests-${VERSION}.tar v${VERSION}
> --
> 2.20.1
>
>
Thanks
Signed-off-by: John Kacur <jkacur@redhat.com>
prev parent reply other threads:[~2020-01-30 19:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-30 8:29 [PATCH] make: Make man page compression configurable Kurt Kanzenbach
2020-01-30 19:45 ` John Kacur [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.21.2001301444460.6499@planxty \
--to=jkacur@redhat.com \
--cc=kurt@linutronix.de \
--cc=linux-rt-users@vger.kernel.org \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox