diff options
author | Erich Eckner <git@eckner.net> | 2016-10-11 14:50:04 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2016-10-11 14:50:04 +0200 |
commit | 5dfad9ce9c93fac864a58be3ae87008b55149e5b (patch) | |
tree | c02ffc8cb7805e0602015f70e388d29321d86fdd /Makefile | |
parent | 309bed54dc3ccff762d966b80e7bebc0f4c25a3f (diff) | |
download | sound-cutter-5dfad9ce9c93fac864a58be3ae87008b55149e5b.tar.xz |
manpage automatisch erstellen
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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 |