From 14aea0eda072d80333cda27c181f4b9cebd420b2 Mon Sep 17 00:00:00 2001 From: Amir Haroush Date: Tue, 16 May 2023 20:46:48 +0300 Subject: [PATCH] Fix compilation distclean race where several tries to rm If we run 'make -j' all 3 targets [modules, casadm, utils] will run in parallel. modules & casadm will then call sync, and then call distcleandir from ocf/Makefile. The distcleandir will try to remove empty directories, but now we have two instances of make trying to do that. Also, what if one of them just created directory to put files in it, and the other just removes it. Make casadm target dependent on modules target will ensure that it will start running only after modules target is done. Signed-off-by: Amir Haroush Signed-off-by: Robert Baldyga --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 4eda4d3..054e39e 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,8 @@ ifneq ($(MAKECMDGOALS),srpm) ifneq ($(MAKECMDGOALS),deb) ifneq ($(MAKECMDGOALS),dsc) cd $@ && $(MAKE) $(MAKECMDGOALS) +casadm: modules + cd $@ && $(MAKE) $(MAKECMDGOALS) endif endif endif