1From 933b2554a40f932571bdbdbb5217cda3e35fd61f Mon Sep 17 00:00:00 2001
2From: "Yann E. MORIN" <yann.morin.1998@free.fr>
3Date: Mon, 27 Nov 2017 12:52:52 +0100
4Subject: [PATCH] build: ensure target directory for modules exists
5
6Currently, in highly-parallel builds, it is possible that installing
7modules fails because the target directory does not exist yet.
8
9We fix that by instructing $(INSTALL) to create the destination directory
10first.
11
12Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
13---
14 Makefile.moddir_rules | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/Makefile.moddir_rules b/Makefile.moddir_rules
18index 59190bece9..b73153a9a5 100644
19--- a/Makefile.moddir_rules
20+++ b/Makefile.moddir_rules
21@@ -110,7 +110,7 @@ clean::
22
23 install:: all
24 	@echo "Installing modules from `basename $(CURDIR)`..."
25-	@for x in $(LOADABLE_MODS:%=%.so); do $(INSTALL) -m 755 $$x "$(DESTDIR)$(ASTMODDIR)" ; done
26+	@for x in $(LOADABLE_MODS:%=%.so); do $(INSTALL) -D -m 755 $$x "$(DESTDIR)$(ASTMODDIR)" ; done
27 ifneq ($(findstring :,$(XMLSTARLET)$(BASH)),:)
28 	@if [ -f .moduleinfo ] ; then \
29 		declare -A DISABLED_MODS ;\
30--
312.11.0
32
33