From 5dfad9ce9c93fac864a58be3ae87008b55149e5b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 11 Oct 2016 14:50:04 +0200 Subject: manpage automatisch erstellen --- Makefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 4a231d2..6392938 100644 --- a/Makefile +++ b/Makefile @@ -25,12 +25,20 @@ MANDIR = /usr/share/man VERSION = 1.0.7 -all: sound-cutter sound-cutter.1 +all: man.commons sound-cutter sound-cutter.1 %: %.in - sed "s/#VERSION#/$(VERSION)/; s@#BINDIR#@$(BINDIR)@" $< > $@ + sed " \ + s/#VERSION#/$(VERSION)/; \ + s@#BINDIR#@$(BINDIR)@; \ + s@#HELPTEXT#\(\s\+\)#@ --help \1display this help and exit\n --version\1display version and exit@; \ + " $< > $@ [ "$@" = "sound-cutter" ] && chmod +x "$@" || true +%.1: % man.commons + grep -v "^$<(" man.commons | sed '/^\[SEE ALSO]$$/{n;:a;N;/\[/b;s/\n/, /;ta;}' > "$<.common" && \ + help2man -o "$@" -N --include $<.common --no-discard-stderr "./$<" + .PHONY: install dist clean install: all @@ -38,7 +46,7 @@ install: all install -D -m0644 sound-cutter.1 $(DESTDIR)$(MANDIR)/man1/sound-cutter.1 clean: - rm -f sound-cutter sound-cutter.1 + git clean -x -d -f dist: clean git status --porcelain 2> /dev/null | grep -q "\S" && (git add .; git commit -m"neue Version: $(VERSION)") || true -- cgit v1.2.3-54-g00ecf