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 <amir.haroush@huawei.com>
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
This commit is contained in:
Amir Haroush 2023-05-16 20:46:48 +03:00 committed by Robert Baldyga
parent 1a1d9507af
commit 14aea0eda0

View File

@ -21,6 +21,8 @@ ifneq ($(MAKECMDGOALS),srpm)
ifneq ($(MAKECMDGOALS),deb)
ifneq ($(MAKECMDGOALS),dsc)
cd $@ && $(MAKE) $(MAKECMDGOALS)
casadm: modules
cd $@ && $(MAKE) $(MAKECMDGOALS)
endif
endif
endif