[LTP] [PATCH] Fix including config.mk and features.mk in env_pre.mk
Jan Stancek
jstancek@redhat.com
Tue Sep 22 12:52:56 CEST 2015
----- Original Message -----
> From: "Yuriy Kolerov" <yuriy.kolerov@synopsys.com>
> To: ltp@lists.linux.it
> Cc: "Anton Kolesov" <Anton.Kolesov@synopsys.com>, "Francois Bedard" <Francois.Bedard@synopsys.com>
> Sent: Thursday, 17 September, 2015 8:51:57 PM
> Subject: [LTP] [PATCH] Fix including config.mk and features.mk in env_pre.mk
>
> If you try to run make in the clean sources tree then it leads
> to the infinite loop.
>
> So check if config.mk or features.mk exists before inclusing and
> don't use "-include" form. The problem is that inclusion of these
> files may lead to the infinite loop if these files don't exist.
> It happens because config.mk and features.mk have recipes and
> Make tries to generate them and include them in env_pre.mk again
> and again until resources are exhausted.
>
> Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
Yuriy, you were first, I tested/pushed your version.
Thanks,
Jan
> ---
> include/mk/env_pre.mk | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/include/mk/env_pre.mk b/include/mk/env_pre.mk
> index 9c757e3..b8d47d4 100644
> --- a/include/mk/env_pre.mk
> +++ b/include/mk/env_pre.mk
> @@ -98,8 +98,12 @@ endif
> # which are filtered below (e.g. clean). However these config files may be
> # needed for those targets (eg. the open posix testsuite is not cleaned even
> if
> # it's enabled by configure) thus it would be wise to do silent inclusion.
> --include $(abs_top_builddir)/include/mk/config.mk
> --include $(abs_top_builddir)/include/mk/features.mk
> +ifneq ("$(wildcard $(abs_top_builddir)/include/mk/config.mk)","")
> +include $(abs_top_builddir)/include/mk/config.mk
> +endif
> +ifneq ("$(wildcard $(abs_top_builddir)/include/mk/features.mk)","")
> +include $(abs_top_builddir)/include/mk/features.mk
> +endif
>
> # autotools, *clean, and help don't require config.mk, features.mk, etc...
> ifeq ($(filter autotools %clean .gitignore gitignore.%
> help,$(MAKECMDGOALS)),)
> --
> 2.2.0
>
>
> --
> Mailing list info: http://lists.linux.it/listinfo/ltp
>
More information about the Ltp
mailing list