Skip to content

Commit 4800543

Browse files
committed
add -p switch to install commands in GNU makefiles
This fixes #340 [skip ci] (cherry picked from commit fc6eb3e)
1 parent 144839a commit 4800543

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

makefile.shared

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo))))
6464

6565
install: $(call print-help,install,Installs the library + headers + pkg-config file) .common_install
6666
sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' libtomcrypt.pc.in > libtomcrypt.pc
67-
install -d $(DESTDIR)$(LIBPATH)/pkgconfig
68-
install -m 644 libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/
67+
install -p -d $(DESTDIR)$(LIBPATH)/pkgconfig
68+
install -p -m 644 libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/
6969

7070
install_bins: $(call print-help,install_bins,Installs the useful demos ($(USEFUL_DEMOS))) .common_install_bins
7171

makefile_include.mk

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -394,23 +394,23 @@ install_all: $(call print-help,install_all,Install everything - library bins doc
394394
INSTALL_OPTS ?= -m 644
395395

396396
.common_install: $(LIBNAME)
397-
install -d $(DESTDIR)$(INCPATH)
398-
install -d $(DESTDIR)$(LIBPATH)
399-
$(INSTALL_CMD) $(INSTALL_OPTS) $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
400-
install -m 644 $(HEADERS) $(DESTDIR)$(INCPATH)
397+
install -p -d $(DESTDIR)$(INCPATH)
398+
install -p -d $(DESTDIR)$(LIBPATH)
399+
$(INSTALL_CMD) -p $(INSTALL_OPTS) $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
400+
install -p -m 644 $(HEADERS) $(DESTDIR)$(INCPATH)
401401

402402
$(DESTDIR)$(BINPATH):
403-
install -d $(DESTDIR)$(BINPATH)
403+
install -p -d $(DESTDIR)$(BINPATH)
404404

405405
.common_install_bins: $(USEFUL_DEMOS) $(DESTDIR)$(BINPATH)
406-
$(INSTALL_CMD) -m 775 $(USEFUL_DEMOS) $(DESTDIR)$(BINPATH)
406+
$(INSTALL_CMD) -p -m 775 $(USEFUL_DEMOS) $(DESTDIR)$(BINPATH)
407407

408408
install_docs: $(call print-help,install_docs,Installs the Developer Manual) doc/crypt.pdf
409-
install -d $(DESTDIR)$(DATAPATH)
410-
install -m 644 doc/crypt.pdf $(DESTDIR)$(DATAPATH)
409+
install -p -d $(DESTDIR)$(DATAPATH)
410+
install -p -m 644 doc/crypt.pdf $(DESTDIR)$(DATAPATH)
411411

412412
install_test: $(call print-help,install_test,Installs the self-test binary) test $(DESTDIR)$(BINPATH)
413-
$(INSTALL_CMD) -m 775 $< $(DESTDIR)$(BINPATH)
413+
$(INSTALL_CMD) -p -m 775 $< $(DESTDIR)$(BINPATH)
414414

415415
install_hooks: $(call print-help,install_hooks,Installs the git hooks)
416416
for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done

0 commit comments

Comments
 (0)