mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Cc: rcz@pengutronix.de
Subject: [PATCH 1/8] kbuild: add include/uapi to path
Date: Mon, 22 Feb 2021 08:05:57 +0100	[thread overview]
Message-ID: <20210222070605.589180-2-ahmad@a3f.at> (raw)
In-Reply-To: <20210222070605.589180-1-ahmad@a3f.at>

Import the necessary bits out of the Linux Makefile, so include/uapi
goes into the path. This allows importing Linux headers without changing
the includes too much. Like with Linux <linux/*.h> is first searched
in include/, then include/uapi. Code that explicitly needs the uapi
header can include <uapi/linux/*.h>.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 Makefile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index f3c85cff9430..67efcc11f2e1 100644
--- a/Makefile
+++ b/Makefile
@@ -408,13 +408,21 @@ LDFLAGS_MODULE  = -T common/module.lds
 # even be read-only.
 export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_versions
 
+# Use USERINCLUDE when you must reference the UAPI directories only.
+USERINCLUDE    := \
+		-I$(srctree)/arch/$(SRCARCH)/include/uapi \
+		-I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \
+		-I$(srctree)/include/uapi \
+		-I$(objtree)/include/generated/uapi \
+                -include $(srctree)/include/linux/kconfig.h
+
 # Use LINUXINCLUDE when you must reference the include/ directory.
 # Needed to be compatible with the O= option
 LINUXINCLUDE    := -Iinclude -I$(srctree)/dts/include \
                    $(if $(building_out_of_srctree), -I$(srctree)/include) \
 		   -I$(srctree)/arch/$(SRCARCH)/include \
 		   -I$(objtree)/arch/$(SRCARCH)/include \
-                   -include $(srctree)/include/linux/kconfig.h
+		   $(USERINCLUDE)
 
 KBUILD_CPPFLAGS        := -D__KERNEL__ -D__BAREBOX__ $(LINUXINCLUDE) -fno-builtin -ffreestanding
 
-- 
2.30.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2021-02-22  7:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22  7:05 [PATCH 0/8] drivers: add VirtIO console, block device support Ahmad Fatoum
2021-02-22  7:05 ` Ahmad Fatoum [this message]
2021-02-22  7:05 ` [PATCH 2/8] driver: Don't throw an error on probes that didn't find the device Ahmad Fatoum
2021-02-22  7:05 ` [PATCH 3/8] drivers: add support for memory-mapped VirtIO paravirtualization Ahmad Fatoum
2021-02-22  7:06 ` [PATCH 4/8] hw_random: add VirtIO RNG driver Ahmad Fatoum
2021-02-22  7:06 ` [PATCH 5/8] serial: add basic VirtIO console driver Ahmad Fatoum
2021-02-22  7:06 ` [PATCH 6/8] block: add VirtIO block device driver Ahmad Fatoum
2021-02-22  7:06 ` [PATCH 7/8] ARM: vexpress: config: update for VirtIO support Ahmad Fatoum
2021-02-22  7:06 ` [PATCH 8/8] Documentation: add Documentation on VirtIO for barebox Ahmad Fatoum
2021-02-22  7:15   ` [PATCH] fixup! " Ahmad Fatoum
2021-02-22  8:39   ` [PATCH] fixup! " Ahmad Fatoum
2021-02-22  9:53 ` [PATCH 0/8] drivers: add VirtIO console, block device support Sascha Hauer

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=20210222070605.589180-2-ahmad@a3f.at \
    --to=ahmad@a3f.at \
    --cc=barebox@lists.infradead.org \
    --cc=rcz@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox