When building Bash 4.4-rc1 with "make -j4", it is possible to get a make error due to the build system attempting to copy a file to a directory before that directory has been created. It will try to copy "Makefile.inc" to $(loadablesdir), but the command to actually create $(loadablesdir) might not be run until later. Specifically, the make output looks like this:

make[1]: Entering directory '/usr/src/bash/xxxbuild/bash-4.4-rc1/examples/loadables' /usr/bin/install: cannot create regular file '/usr/lib/bash/Makefile.inc': No such file or directory
Makefile:238: recipe for target 'install-dev' failed
make[1]: *** [install-dev] Error 1
make[1]: *** Waiting for unfinished jobs....
mkdir -p -- /usr/lib/bash
make[1]: Leaving directory '/usr/src/bash/xxxbuild/bash-4.4-rc1/examples/loadables'

This can be fixed by requiring the "installdirs" target as a prerequisite for "install-dev" in examples/loadables/Makefile.
diff -Naur bash-4.4-rc1.orig/examples/loadables/Makefile.in 
bash-4.4-rc1/examples/loadables/Makefile.in
--- bash-4.4-rc1.orig/examples/loadables/Makefile.in    2015-12-28 
18:44:45.000000000 -0500
+++ bash-4.4-rc1/examples/loadables/Makefile.in 2016-03-05 04:58:28.000000000 
-0500
@@ -234,7 +234,7 @@
 installdirs:
        @${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(loadablesdir)
 
-install-dev:
+install-dev: installdirs
        @$(INSTALL_DATA) Makefile.inc $(DESTDIR)$(loadablesdir)/Makefile.inc
        @( cd $(BUILD_DIR) && ${MAKE} ${MFLAGS} DESTDIR="$(DESTDIR)" 
install-headers)
 

Reply via email to