From 4800543664ead64dce11aee867c517993155d01c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 20 Jan 2018 15:10:53 +0100 Subject: [PATCH] add -p switch to `install` commands in GNU makefiles This fixes #340 [skip ci] (cherry picked from commit fc6eb3ecf07e1cceb5ce85907db8191877704570) --- makefile.shared | 4 ++-- makefile_include.mk | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/makefile.shared b/makefile.shared index 4bc6015..66b9dd5 100644 --- a/makefile.shared +++ b/makefile.shared @@ -64,8 +64,8 @@ $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) install: $(call print-help,install,Installs the library + headers + pkg-config file) .common_install sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' libtomcrypt.pc.in > libtomcrypt.pc - install -d $(DESTDIR)$(LIBPATH)/pkgconfig - install -m 644 libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/ + install -p -d $(DESTDIR)$(LIBPATH)/pkgconfig + install -p -m 644 libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/ install_bins: $(call print-help,install_bins,Installs the useful demos ($(USEFUL_DEMOS))) .common_install_bins diff --git a/makefile_include.mk b/makefile_include.mk index dd45cac..f4e14e4 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -394,23 +394,23 @@ install_all: $(call print-help,install_all,Install everything - library bins doc INSTALL_OPTS ?= -m 644 .common_install: $(LIBNAME) - install -d $(DESTDIR)$(INCPATH) - install -d $(DESTDIR)$(LIBPATH) - $(INSTALL_CMD) $(INSTALL_OPTS) $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME) - install -m 644 $(HEADERS) $(DESTDIR)$(INCPATH) + install -p -d $(DESTDIR)$(INCPATH) + install -p -d $(DESTDIR)$(LIBPATH) + $(INSTALL_CMD) -p $(INSTALL_OPTS) $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME) + install -p -m 644 $(HEADERS) $(DESTDIR)$(INCPATH) $(DESTDIR)$(BINPATH): - install -d $(DESTDIR)$(BINPATH) + install -p -d $(DESTDIR)$(BINPATH) .common_install_bins: $(USEFUL_DEMOS) $(DESTDIR)$(BINPATH) - $(INSTALL_CMD) -m 775 $(USEFUL_DEMOS) $(DESTDIR)$(BINPATH) + $(INSTALL_CMD) -p -m 775 $(USEFUL_DEMOS) $(DESTDIR)$(BINPATH) install_docs: $(call print-help,install_docs,Installs the Developer Manual) doc/crypt.pdf - install -d $(DESTDIR)$(DATAPATH) - install -m 644 doc/crypt.pdf $(DESTDIR)$(DATAPATH) + install -p -d $(DESTDIR)$(DATAPATH) + install -p -m 644 doc/crypt.pdf $(DESTDIR)$(DATAPATH) install_test: $(call print-help,install_test,Installs the self-test binary) test $(DESTDIR)$(BINPATH) - $(INSTALL_CMD) -m 775 $< $(DESTDIR)$(BINPATH) + $(INSTALL_CMD) -p -m 775 $< $(DESTDIR)$(BINPATH) install_hooks: $(call print-help,install_hooks,Installs the git hooks) for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done