From 351f3b01ab536c9084ead0ffc4f5cb5671a52e52 Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Thu, 27 Jun 2019 17:38:11 +0200 Subject: Makefile: "make doc" to generate man pages --- Makefile | 16 ++++++++++++++++ doc/.gitignore | 1 + doc/pod2man.pl | 8 ++++++++ 3 files changed, 25 insertions(+) create mode 100644 Makefile create mode 100644 doc/.gitignore create mode 100755 doc/pod2man.pl diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9acde80 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +UTILS := tgrecv tgsend tgserver + +doc: $(addprefix doc/man1/,$(addsuffix .1.bz2,${UTILS})) + +clean: + rm -rf doc/man1 + +.PHONY: doc clean + + +# https://www.gnu.org/software/make/manual/html_node/Secondary-Expansion.html +.SECONDEXPANSION: +%.1.bz2: $$(notdir $$*) + @mkdir -p $(dir $*) + doc/pod2man.pl $(notdir $*) $*.1 + bzip2 -f $*.1 diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 0000000..f9f965c --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1 @@ +man1 \ No newline at end of file diff --git a/doc/pod2man.pl b/doc/pod2man.pl new file mode 100755 index 0000000..f95f94b --- /dev/null +++ b/doc/pod2man.pl @@ -0,0 +1,8 @@ +#!/usr/bin/env perl + +use strict; +use warnings; + +use Pod::Man; + +Pod::Man->new(release => 1, section => 1)->parse_from_file(@ARGV[0 .. 1]); -- cgit v1.2.3