summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile72
1 files changed, 32 insertions, 40 deletions
diff --git a/Makefile b/Makefile
index 02b042c..97b041b 100644
--- a/Makefile
+++ b/Makefile
@@ -10,73 +10,65 @@ DIRS = \
/usr/lib/initcpio/install \
/usr/lib/initcpio/udev \
/usr/share/man/man8 \
+ /usr/share/man/man5 \
/usr/share/man/man1
-DIST_EXTRA = \
+all: doc
+
+MANPAGES = \
mkinitcpio.8 \
lsinitcpio.1
-all: doc
-
install: all
- mkdir -p ${DESTDIR}
- $(foreach dir,${DIRS},install -dm755 ${DESTDIR}${dir};)
+ mkdir -p $(DESTDIR)
+ $(foreach dir,$(DIRS),install -dm755 $(DESTDIR)$(dir);)
sed -e 's|^_f_config=.*|_f_config=/etc/mkinitcpio.conf|' \
-e 's|^_f_functions=.*|_f_functions=/usr/lib/initcpio/functions|' \
-e 's|^_d_hooks=.*|_d_hooks=({/usr,}/lib/initcpio/hooks)|' \
-e 's|^_d_install=.*|_d_install=({/usr,}/lib/initcpio/install)|' \
-e 's|^_d_presets=.*|_d_presets=/etc/mkinitcpio.d|' \
- -e 's|%VERSION%|${VERSION}|g' \
- < mkinitcpio > ${DESTDIR}/usr/bin/mkinitcpio
+ -e 's|%VERSION%|$(VERSION)|g' \
+ < mkinitcpio > $(DESTDIR)/usr/bin/mkinitcpio
sed -e 's|\(^_f_functions\)=.*|\1=/usr/lib/initcpio/functions|' \
- -e 's|%VERSION%|${VERSION}|g' \
- < lsinitcpio > ${DESTDIR}/usr/bin/lsinitcpio
+ -e 's|%VERSION%|$(VERSION)|g' \
+ < lsinitcpio > $(DESTDIR)/usr/bin/lsinitcpio
- chmod 755 ${DESTDIR}/usr/bin/lsinitcpio ${DESTDIR}/usr/bin/mkinitcpio
+ chmod 755 $(DESTDIR)/usr/bin/lsinitcpio $(DESTDIR)/usr/bin/mkinitcpio
- install -m644 mkinitcpio.conf ${DESTDIR}/etc/mkinitcpio.conf
- install -m755 -t ${DESTDIR}/usr/lib/initcpio init shutdown
- install -m644 -t ${DESTDIR}/usr/lib/initcpio init_functions functions
- install -m644 01-memdisk.rules ${DESTDIR}/usr/lib/initcpio/udev/01-memdisk.rules
+ install -m644 mkinitcpio.conf $(DESTDIR)/etc/mkinitcpio.conf
+ install -m755 -t $(DESTDIR)/usr/lib/initcpio init shutdown
+ install -m644 -t $(DESTDIR)/usr/lib/initcpio init_functions functions
+ install -m644 01-memdisk.rules $(DESTDIR)/usr/lib/initcpio/udev/01-memdisk.rules
- install -m644 -t ${DESTDIR}/usr/lib/initcpio/hooks hooks/*
- install -m644 -t ${DESTDIR}/usr/lib/initcpio/install install/*
- install -m644 -t ${DESTDIR}/etc/mkinitcpio.d mkinitcpio.d/*
+ cp -at $(DESTDIR)/usr/lib/initcpio/hooks hooks/*
+ cp -at $(DESTDIR)/usr/lib/initcpio/install install/*
+ cp -at $(DESTDIR)/etc/mkinitcpio.d mkinitcpio.d/*
- install -m644 mkinitcpio.8 ${DESTDIR}/usr/share/man/man8/mkinitcpio.8
- install -m644 lsinitcpio.1 ${DESTDIR}/usr/share/man/man1/lsinitcpio.1
- install -m644 bash-completion ${DESTDIR}/usr/share/bash-completion/completions/mkinitcpio
- ln -s mkinitcpio ${DESTDIR}/usr/share/bash-completion/completions/lsinitcpio
+ install -m644 mkinitcpio.8 $(DESTDIR)/usr/share/man/man8/mkinitcpio.8
+ install -m644 lsinitcpio.1 $(DESTDIR)/usr/share/man/man1/lsinitcpio.1
+ install -m644 bash-completion $(DESTDIR)/usr/share/bash-completion/completions/mkinitcpio
+ ln -s mkinitcpio $(DESTDIR)/usr/share/bash-completion/completions/lsinitcpio
-doc: mkinitcpio.8 lsinitcpio.1
-mkinitcpio.8: mkinitcpio.8.txt Makefile
+doc: $(MANPAGES)
+%: %.txt Makefile
a2x -d manpage \
-f manpage \
- -a mansource=mkinitcpio \
- -a manversion=${VERSION} \
- -a manmanual=mkinitcpio mkinitcpio.8.txt
-
-lsinitcpio.1: lsinitcpio.1.txt Makefile
- a2x -d manpage \
- -f manpage \
- -a mansource=lsinitcpio \
- -a manversion=${VERSION} \
- -a manmanual=lsinitcpio lsinitcpio.1.txt
+ -a manversion=$(VERSION) \
+ -a manmanual="mkinitcpio manual" $<
clean:
- ${RM} -r build mkinitcpio-${VERSION}
- ${RM} mkinitcpio-${VERSION}.tar.gz mkinitcpio.8 lsinitcpio.1
+ $(RM) -r build mkinitcpio-$(VERSION)
+ $(RM) mkinitcpio-${VERSION}.tar.gz $(MANPAGES)
dist: doc
- echo ${VERSION} > VERSION
+ echo $(VERSION) > VERSION
git ls-files -z | xargs -0 \
- bsdtar -czf mkinitcpio-${VERSION}.tar.gz -s ,^,mkinitcpio-${VERSION}/, VERSION ${DIST_EXTRA}
- ${RM} VERSION
-
+ bsdtar -czf mkinitcpio-$(VERSION).tar.gz -s ,^,mkinitcpio-$(VERSION)/, VERSION $(MANPAGES)
+ $(RM) VERSION
version:
- @echo ${VERSION}
+ @echo $(VERSION)
.PHONY: clean dist install tarball version