summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 11 insertions, 3 deletions
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