From 3d6c7008e582b4009dd26390296b6ed91ec141ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Kijewski?= Date: Fri, 16 May 2014 19:09:22 +0200 Subject: [PATCH] make: make clean usable together with `-j` --- Makefile.include | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile.include b/Makefile.include index d0cbe7ddc0..0b0bcf6d87 100644 --- a/Makefile.include +++ b/Makefile.include @@ -106,6 +106,11 @@ USEMODULE_INCLUDES_ = $(shell echo $(USEMODULE_INCLUDES) | tr ' ' '\n' | awk '!a INCLUDES += $(USEMODULE_INCLUDES_:%=-I%) +# The `clean` needs to be serialized before everything else. +ifneq (, $(filter clean, $(MAKECMDGOALS))) + $(OBJ) $(BASELIBS) $(USEPKG:%=$(RIOTBASE)/pkg/%/Makefile.include): clean +endif + # include Makefile.includes for packages in $(USEPKG) $(RIOTBASE)/pkg/%/Makefile.include:: $(AD)"$(MAKE)" -C $(RIOTBASE)/pkg/$* Makefile.include