diff options
author | Erich Eckner <git@eckner.net> | 2016-10-11 16:24:29 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2016-10-11 16:24:29 +0200 |
commit | ea8f0eb2fcce875fb25e4139b9fde75db1bc5655 (patch) | |
tree | e92cbc0cffc91cf94eb7c62f2d60ce636e94f283 /Makefile | |
parent | 226791f308cfac82860f03c7daea7d1e4ea3bd6c (diff) | |
download | sendmailadvanced-ea8f0eb2fcce875fb25e4139b9fde75db1bc5655.tar.xz |
manpage automatisch aus Hilfe erstellen
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -26,10 +26,22 @@ MANDIR = /usr/share/man VERSION = 1.0.10 -all: sendmailadvanced sendmailadvanced.1 +all: man.commons sendmailadvanced sendmailadvanced.1 %: %.in - sed "s/#VERSION#/$(VERSION)/; s@#BINDIR#@$(BINDIR)@; s@#ETCDIR#@$(ETCDIR)@" $< > $@ + sed " \ + s/#VERSION#/$(VERSION)/; \ + s@#BINDIR#@$(BINDIR)@; \ + s@#ETCDIR#@$(ETCDIR)@; \ + s@#HELPTEXT#\(\s\+\)#@ --help \1display this help and exit\n --version\1display version and exit@; \ + " $< > $@ + [ "$@" = "sendmailadvanced" ] && chmod +x "$@" || true + +%.1: % man.commons + grep -v "^$<(" man.commons | sed '/^\[SEE ALSO]$$/{n;:a;N;/\[/b;s/\n/, /;ta;}' > "$<.common" && \ + help2man \ + -n 'Wrapper for sendmail which encrypts and generates stamps' \ + -o "$@" -N --include $<.common --no-discard-stderr "./$<" .PHONY: install dist clean @@ -39,7 +51,9 @@ install: all install -D -m0644 sendmailadvanced.conf $(DESTDIR)$(ETCDIR)/sendmailadvanced.conf clean: - rm -f sendmailadvanced sendmailadvanced.1 + ls -A | \ + grep "^\($(shell cat .gitignore | sed 's|\.|\\.|; s|\*|.*|; s|$$|\\|' | tr '\n' '\|' )\)\$$" | \ + xargs -r rm dist: clean git status --porcelain 2> /dev/null | grep -q "\S" && (git add .; git commit -m"neue Version: $(VERSION)") || true |