From 903564349edb8e2ef457a5dbf09d3ed9c9c206f5 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 11 Oct 2016 13:32:46 +0200 Subject: alle manpages sollten jetzt funktionieren --- Makefile | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 805b51d..90b42c1 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,7 @@ # USA. # +SHELL = /bin/bash DESTDIR = ETCDIR = /etc BINDIR = /usr/bin @@ -26,15 +27,20 @@ MANDIR = /usr/share/man VERSION = 1.1 -all: backup backup.1 lastBackups lastBackups.1 backupStatistics backupStatistics.1 +all: man.commons backup backup.1 lastBackups lastBackups.1 backupStatistics backupStatistics.1 %: %.in - sed "s/#VERSION#/$(VERSION)/; s@#BINDIR#@$(BINDIR)@; s@#ETCDIR#@$(ETCDIR)@; s@#NUMSTAGES#@5@" $< > $@ - -%.common: man.commons - grep -v "^$(@:.common=)(" $< > $@ - -%.1: % %.common + sed " \ + s/#VERSION#/$(VERSION)/; \ + s@#BINDIR#@$(BINDIR)@; \ + s@#ETCDIR#@$(ETCDIR)@; \ + s@#NUMSTAGES#@5@; \ + s@#HELPTEXT#\(\s\+\)#@ --help \1display this help and exit\n --version\1display version and exit@; \ + " $< > $@ && \ + ( [[ "$@" = *.* ]] || chmod +x "$@" ) + +%.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 @@ -45,7 +51,7 @@ install: all install -D -m0644 -t $(DESTDIR)$(ETCDIR) backup.conf clean: - cat .gitignore | xargs rm -f + 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