aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2012-03-12 14:36:45 +0100
committerLukas Fleischer <archlinux@cryptocrack.de>2012-03-12 15:14:58 +0100
commit1b653d6986714848a848b421c50dafe2868829e6 (patch)
tree5eae830ba4f8e426512df1325460c8e97c5c4126
parent523e05098af3b9233d286a0f31afe7e879bcd6a8 (diff)
downloadinitscripts-1b653d6986714848a848b421c50dafe2868829e6.tar.xz
Makefile: Rework man page handling
* Move the list of man page files to a variable to avoid code duplication. Also, use generic code in the install target and extract man pages from the newly introduced variable. * Use generic (wildcard) rules for man page generation instead of having one rule per source/target file. * Use "$(DESTDIR)" instead of "${DESTDIR}" everywhere. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
-rw-r--r--Makefile33
1 files changed, 16 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index 1081730..a429ddd 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
VER := $(shell git describe)
+
DIRS := \
/etc/rc.d \
/etc/conf.d \
@@ -16,6 +17,13 @@ DIRS := \
/usr/share/man/man5 \
/usr/share/man/man8
+MAN_PAGES := \
+ rc.d.8 \
+ rc.conf.5 \
+ locale.conf.5 \
+ vconsole.conf.5 \
+ hostname.5
+
all: doc
installdirs:
@@ -29,32 +37,23 @@ install: installdirs doc
install -m755 -t $(DESTDIR)/etc/rc.d hwclock network netfs
install -m755 -t $(DESTDIR)/etc/profile.d locale.sh
install -m755 -t $(DESTDIR)/usr/sbin rc.d
- install -m644 -t ${DESTDIR}/usr/share/man/man8 rc.d.8
- install -m644 -t ${DESTDIR}/usr/share/man/man5 rc.conf.5 locale.conf.5 vconsole.conf.5 hostname.5
+ install -m644 -t $(DESTDIR)/usr/share/man/man5 $(filter %.5, $(MAN_PAGES))
+ install -m644 -t $(DESTDIR)/usr/share/man/man8 $(filter %.8, $(MAN_PAGES))
install -m755 -t $(DESTDIR)/usr/lib/initscripts arch-tmpfiles arch-sysctl
install -m644 tmpfiles.conf $(DESTDIR)/usr/lib/tmpfiles.d/arch.conf
install -m644 -T bash-completion $(DESTDIR)/etc/bash_completion.d/rc.d
install -m644 -T zsh-completion $(DESTDIR)/usr/share/zsh/site-functions/_rc.d
-rc.d.8: rc.d.8.txt
- a2x -d manpage -f manpage rc.d.8.txt
-
-rc.conf.5: rc.conf.5.txt
- a2x -d manpage -f manpage rc.conf.5.txt
-
-locale.conf.5: locale.conf.5.txt
- a2x -d manpage -f manpage locale.conf.5.txt
-
-vconsole.conf.5: vconsole.conf.5.txt
- a2x -d manpage -f manpage vconsole.conf.5.txt
+%.5: %.5.txt
+ a2x -d manpage -f manpage $<
-hostname.5: hostname.5.txt
- a2x -d manpage -f manpage hostname.5.txt
+%.8: %.8.txt
+ a2x -d manpage -f manpage $<
-doc: rc.d.8 rc.conf.5 locale.conf.5 vconsole.conf.5 hostname.5
+doc: $(MAN_PAGES)
clean:
- rm -f rc.d.8 rc.conf.5 locale.conf.5 vconsole.conf.5 hostname.5
+ rm -f $(MAN_PAGES)
tar:
git archive HEAD --prefix=initscripts-$(VER)/ | xz > initscripts-$(VER).tar.xz