From 7d0e9d91b63a2425321d0e9a0d15f92d1d8e814d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 19 Apr 2020 12:24:51 +0200 Subject: [PATCH] Create leading directories when installing Note: install(1) is not really specified and the -D option does not seem to be portable. For example the FreeBSD manual page documents a different behavior. We therefore use a somewhat ugly two step process with an installdirs target. --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a3bb9ff..3dbb2e7 100644 --- a/Makefile +++ b/Makefile @@ -36,9 +36,13 @@ dist: clean @echo creating dist tarball @git archive --prefix=abduco-${VERSION}/ -o abduco-${VERSION}.tar.gz HEAD -install: abduco +installdirs: + @${INSTALL} -d ${DESTDIR}${PREFIX}/bin \ + ${DESTDIR}${MANPREFIX}/man1 + +install: abduco installdirs @echo installing executable file to ${DESTDIR}${PREFIX}/bin - @${INSTALL} abduco ${DESTDIR}${PREFIX}/bin + @${INSTALL} -m 0755 abduco ${DESTDIR}${PREFIX}/bin @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 @mkdir -p ${DESTDIR}${MANPREFIX}/man1 @sed "s/VERSION/${VERSION}/g" < abduco.1 > ${DESTDIR}${MANPREFIX}/man1/abduco.1 @@ -57,4 +61,4 @@ uninstall: @echo removing zsh completion file from ${DESTDIR}/usr/share/zsh/site-functions @rm -f ${DESTDIR}${ZSHPREFIX}/share/zsh/site-functions/_abduco -.PHONY: all clean dist install install-strip uninstall debug +.PHONY: all clean dist install installdirs install-strip uninstall debug