# HG changeset patch # User "Yann E. MORIN" # Date 1307202229 -7200 # Node ID f87f02b00cc777772a0556d700b7f12804f6d661 # Parent 3fc114996b20a407331efc8534124e41ddd0372a Makefile: make it work for auto-completion The latest autocompletion calls 'make -qp' to get all the possible targets. This currently fails, as our makefile is calling itself again and again ad-libitum. Fix it by detecting that the recursion level is not 0, and bail out if so. It works so well that it has the side effect of showing only the 'public' target, and hide our internal ones! :-) Signed-off-by: "Yann E. MORIN" diff -r 3fc114996b20 -r f87f02b00cc7 Makefile.in --- a/Makefile.in Sat Jun 04 17:15:58 2011 +0200 +++ b/Makefile.in Sat Jun 04 17:43:49 2011 +0200 @@ -88,6 +88,17 @@ # See top of file for an explanation of why this is needed... ifneq ($(strip $(CT_MAKEFLAGS)),) +# Somehow, the new auto-completion for make in the recent distributions +# trigger a behavior where our Makefile calls itself recursively, in a +# never-ending loop (except on lack of ressources, swap, PIDs...) +# Avoid this situation by cutting the recursion short at the first +# level. +# This has the side effect of only showing the real targets, and hiding our +# internal ones. :-) +ifneq ($(MAKELEVEL),0) +$(error Recursion detected, bailing out...) +endif + MAKEFLAGS += $(CT_MAKEFLAGS) build install clean distclean uninstall: @$(MAKE) $@