From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Wed, 19 Aug 2020 09:09:06 -0400 Subject: [RFCv2 14/16] common: Move the build-system includes to a separate file In-Reply-To: <20200819130908.4303-1-trini@konsulko.com> References: <20200802225940.51457-1-sjg@chromium.org> <20200819130908.4303-1-trini@konsulko.com> Message-ID: <20200819130908.4303-15-trini@konsulko.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Simon Glass At present common.h is used by the build system when calculating dependencies. Move it out into a separate file so we can drop the env_internal.h inclusion from common. Signed-off-by: Simon Glass --- arch/nds32/lib/asm-offsets.c | 1 + include/common.h | 5 ----- include/deps_internal.h | 18 ++++++++++++++++++ scripts/Makefile.autoconf | 8 +++++--- 4 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 include/deps_internal.h diff --git a/arch/nds32/lib/asm-offsets.c b/arch/nds32/lib/asm-offsets.c index 39e3480bd52f..7412b788d793 100644 --- a/arch/nds32/lib/asm-offsets.c +++ b/arch/nds32/lib/asm-offsets.c @@ -10,6 +10,7 @@ * published by the Free Software Foundation. */ #include +#include #include diff --git a/include/common.h b/include/common.h index 2e95d0ebdf5d..1a9a2ce0ea85 100644 --- a/include/common.h +++ b/include/common.h @@ -16,9 +16,4 @@ #include #endif /* __ASSEMBLY__ */ -/* Pull in stuff for the build system */ -#ifdef DO_DEPS_ONLY -# include -#endif - #endif /* __COMMON_H_ */ diff --git a/include/deps_internal.h b/include/deps_internal.h new file mode 100644 index 000000000000..9c3b31cc5771 --- /dev/null +++ b/include/deps_internal.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Internal header file used by the build system to calculate dependences + * + * (C) Copyright 2000-2009 + * Wolfgang Denk, DENX Software Engineering, wd at denx.de. + */ + +#ifndef __DEPS_INTERNAL +#define __DEPS_INTERNAL + +#ifndef __ASSEMBLY__ +#include +#endif + +#include + +#endif /* __DEPS_INTERNAL */ diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf index 0bfc1b2a6292..89882e3c71a4 100644 --- a/scripts/Makefile.autoconf +++ b/scripts/Makefile.autoconf @@ -41,8 +41,9 @@ c_flags := $(KBUILD_CFLAGS) $(KBUILD_CPPFLAGS) $(PLATFORM_CPPFLAGS) \ quiet_cmd_autoconf_dep = GEN $@ cmd_autoconf_dep = $(CC) -x c -DDO_DEPS_ONLY -M -MP $(c_flags) \ - -MQ include/config/auto.conf $(srctree)/include/common.h > $@ || { \ - rm $@; false; \ + -MQ include/config/auto.conf $(srctree)/include/deps_internal.h > $@ \ + || { \ + rm $@; false; \ } include/autoconf.mk.dep: include/config.h FORCE $(call cmd,autoconf_dep) @@ -66,7 +67,8 @@ quiet_cmd_autoconf = GEN $@ quiet_cmd_u_boot_cfg = CFG $@ cmd_u_boot_cfg = \ - $(CPP) $(c_flags) $2 -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && { \ + $(CPP) $(c_flags) $2 -DDO_DEPS_ONLY -dM \ + $(srctree)/include/deps_internal.h > $@.tmp && { \ grep 'define CONFIG_' $@.tmp > $@; \ rm $@.tmp; \ } || { \ -- 2.17.1