All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [RFCv2 14/16] common: Move the build-system includes to a separate file
Date: Wed, 19 Aug 2020 09:09:06 -0400	[thread overview]
Message-ID: <20200819130908.4303-15-trini@konsulko.com> (raw)
In-Reply-To: <20200819130908.4303-1-trini@konsulko.com>

From: Simon Glass <sjg@chromium.org>

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 <sjg@chromium.org>
---
 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 <common.h>
+#include <compiler.h>
 
 #include <linux/kbuild.h>
 
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 <config.h>
 #endif	/* __ASSEMBLY__ */
 
-/* Pull in stuff for the build system */
-#ifdef DO_DEPS_ONLY
-# include <env_internal.h>
-#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 <config.h>
+#endif
+
+#include <env_internal.h>
+
+#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

  parent reply	other threads:[~2020-08-19 13:09 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-02 22:59 [PATCH 00/16] common: Drop remaining includes in common.h Simon Glass
2020-08-02 22:59 ` [PATCH 01/16] common: Drop asm/global_data.h from common header Simon Glass
2020-08-02 22:59 ` [PATCH 02/16] common: Drop display_options.h " Simon Glass
2020-08-02 22:59 ` [PATCH 03/16] common: Drop linux/printk.h " Simon Glass
2020-08-02 22:59 ` [PATCH 04/16] Fix code style for time functions Simon Glass
2020-08-02 22:59 ` [PATCH 05/16] common: Drop time.h from common header Simon Glass
2020-08-02 22:59 ` [PATCH 06/16] common: Drop linux/string.h " Simon Glass
2020-08-02 22:59 ` [PATCH 07/16] common: Drop asm/u-boot.h " Simon Glass
2020-08-02 22:59 ` [PATCH 08/16] common: Drop stdio.h " Simon Glass
2020-08-02 22:59 ` [PATCH 09/16] common: Drop stdarg.h " Simon Glass
2020-08-02 22:59 ` [PATCH 10/16] common: Drop vsprintf.h " Simon Glass
2020-08-02 22:59 ` [PATCH 11/16] common: Drop errno.h " Simon Glass
2020-08-02 22:59 ` [PATCH 12/16] common: Drop linux/kernel.h " Simon Glass
2020-08-02 22:59 ` [PATCH 13/16] common: Drop linux/types.h " Simon Glass
2020-08-02 22:59 ` [PATCH 14/16] common: Move the build-system includes to a separate file Simon Glass
2020-08-02 22:59 ` [PATCH 15/16] common: Add a comment about the current state of common.h Simon Glass
2020-08-02 22:59 ` [PATCH 16/16] Makefile: Drop linux/kconfig.h from config.h Simon Glass
2020-08-19 13:08 ` [RFCv2] common: Drop remaining includes in common.h Tom Rini
2020-08-19 13:08   ` [RFCv2 01/16] common: Drop asm/global_data.h from common header Tom Rini
2020-08-19 13:08   ` [RFCv2 02/16] common: Drop display_options.h " Tom Rini
2020-08-19 13:08   ` [RFCv2 03/16] common: Drop linux/printk.h " Tom Rini
2020-08-19 13:08   ` [RFCv2 04/16] Fix code style for time functions Tom Rini
2020-08-19 13:08   ` [RFCv2 05/16] common: Drop time.h from common header Tom Rini
2020-08-19 13:08   ` [RFCv2 06/16] common: Drop linux/string.h " Tom Rini
2020-08-19 13:08   ` [RFCv2 07/16] common: Drop asm/u-boot.h " Tom Rini
2020-08-19 13:09   ` [RFCv2 08/16] common: Drop stdio.h " Tom Rini
2020-08-19 13:09   ` [RFCv2 09/16] common: Drop stdarg.h " Tom Rini
2020-08-19 13:09   ` [RFCv2 10/16] common: Drop vsprintf.h " Tom Rini
2020-08-19 13:09   ` [RFCv2 11/16] common: Drop errno.h " Tom Rini
2020-08-19 13:09   ` [RFCv2 12/16] common: Drop linux/kernel.h " Tom Rini
2020-08-19 13:09   ` [RFCv2 13/16] common: Drop linux/types.h " Tom Rini
2020-08-19 13:09   ` Tom Rini [this message]
2020-08-19 13:09   ` [RFCv2 15/16] common: Add a comment about the current state of common.h Tom Rini
2020-08-19 13:09   ` [RFCv2 16/16] Makefile: Drop linux/kconfig.h from config.h Tom Rini
2020-09-09  2:58   ` [RFCv2] common: Drop remaining includes in common.h Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200819130908.4303-15-trini@konsulko.com \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.