Files
ethercat/Makefile.kbuild
Nicola Fontana 89f81d638c Fix make clean
Commit 82399a9239 assumes you can override `make clean` on the fact
that prerequisites of the same target are merged. This is true but
unfortunately defining a `clean` target prevents automake from
generating its own one, hence the default clean actions are not
performed. This can be easily seen by inspecting the generated
`Makefile`.

Solve this issue by manually chaining up the default action.
2021-07-22 17:38:38 +02:00

29 lines
674 B
Makefile

# Shared makefile code providing support for Kbuild make. It is included
# by every `Makefile.am` that needs Kbuild support with:
# ```
# include $(top_srcdir)/Makefile.kbuild
# ```
KBUILD = $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(abs_srcdir)" INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)"
modules:
$(KBUILD) modules
modules_install:
$(KBUILD) modules_install
# 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
.PHONY: kbuild-clean