From 3e821677f6019525b1750ba300d65d5f662174f5 Mon Sep 17 00:00:00 2001 From: Florian Pose Date: Tue, 24 Aug 2021 16:04:31 +0000 Subject: [PATCH] Merge branch 'fix-make-clean' into 'stable-1.5' Fix make clean See merge request etherlab.org/ethercat!29 (cherry picked from commit dde91be4be1937ddf086920a1fa29744fe5dbdb3) 89f81d63 Fix make clean --- Makefile.kbuild | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Makefile.kbuild b/Makefile.kbuild index a419b939..79515ed2 100644 --- a/Makefile.kbuild +++ b/Makefile.kbuild @@ -13,15 +13,14 @@ modules_install: $(KBUILD) modules_install -# Call Kbuild clean *before* automake `clean` (see #5 for the rationale) -# by adding `kbuild-clean` to the clean prerequisites. Having targets -# with the same name will result in merging the prerequisites, i.e.: -# ``` -# # Equivalent to 'clean: prerequisite1 prerequisite2' -# clean: prerequisite1 -# clean: prerequisite2 -# ``` +# Override default `clean` target to call Kbuild clean *before* automake +# `clean` (see #5 for the rationale). clean: kbuild-clean + @if test -z "$(SUBDIRS)"; then \ + $(MAKE) $(AM_MAKEFLAGS) clean-am ; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) clean-recursive ; \ + fi kbuild-clean: $(KBUILD) clean