From: Sam Ravnborg <sam@ravnborg.org>
To: LKML <linux-kernel@vger.kernel.org>,
linux-kbuild <linux-kbuild@vger.kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Subject: [PATCH] kbuild: support arch/$ARCH/include/...
Date: Sun, 22 Jun 2008 00:08:51 +0200 [thread overview]
Message-ID: <20080621220851.GC12279@uranus.ravnborg.org> (raw)
In-Reply-To: <20080621220703.GA12279@uranus.ravnborg.org>
From d888d09887a0231e494e7009d855bd3e3c35bfd9 Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <sam@ravnborg.org>
Date: Sat, 21 Jun 2008 01:07:38 +0200
Subject: [PATCH] kbuild: support arch/$ARCH/include/...
Unconditionally add arch/$ARCH/include to the gcc search path.
Create asm symlink only when we need them
Save asm-offset in include/asm
Delete include/asm during mrproper being it a link or a directory
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
Kbuild | 2 +-
Makefile | 35 ++++++++++++++++++++---------------
2 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/Kbuild b/Kbuild
index e750e9c..254a6af 100644
--- a/Kbuild
+++ b/Kbuild
@@ -43,7 +43,7 @@ $(obj)/$(bounds-file): kernel/bounds.s Kbuild
# 2) Generate asm-offsets.h
#
-offsets-file := include/asm-$(SRCARCH)/asm-offsets.h
+offsets-file := include/asm/asm-offsets.h
always += $(offsets-file)
targets += $(offsets-file)
diff --git a/Makefile b/Makefile
index e309a87..70dc0a8 100644
--- a/Makefile
+++ b/Makefile
@@ -329,7 +329,8 @@ AFLAGS_KERNEL =
# Needed to be compatible with the O= option
LINUXINCLUDE := -Iinclude \
$(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \
- -include include/linux/autoconf.h
+ -I$(srctree)/arch/$(hdr-arch)/include \
+ -include include/linux/autoconf.h
KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
@@ -921,7 +922,9 @@ ifneq ($(KBUILD_SRC),)
/bin/false; \
fi;
$(Q)if [ ! -d include2 ]; then mkdir -p include2; fi;
- $(Q)ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm
+ $(Q)if [ -e $(srctree)/include/asm-$(SRCARCH)/system.h ]; then \
+ ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm; \
+ fi
endif
# prepare2 creates a makefile if using a separate output directory
@@ -949,19 +952,21 @@ export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH)
# Detect this and ask user to run make mrproper
include/asm: FORCE
- $(Q)set -e; asmlink=`readlink include/asm | cut -d '-' -f 2`; \
- if [ -L include/asm ]; then \
- if [ "$$asmlink" != "$(SRCARCH)" ]; then \
+ $(Q)set -e; asmlink=`readlink include/asm | cut -d '-' -f 2`; \
+ if [ -L include/asm ]; then \
+ if [ "$$asmlink" != "$(SRCARCH)" ]; then \
echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \
echo " set ARCH or save .config and run 'make mrproper' to fix it"; \
- exit 1; \
- fi; \
- else \
- echo ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \
- if [ ! -d include ]; then \
- mkdir -p include; \
- fi; \
- ln -fsn asm-$(SRCARCH) $@; \
+ exit 1; \
+ fi; \
+ else \
+ if [ -e $(srctree)/include/asm-$(SRCARCH)/system.h ]; then \
+ echo ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \
+ if [ ! -d include ]; then \
+ mkdir -p include; \
+ fi; \
+ ln -fsn asm-$(SRCARCH) $@; \
+ fi \
fi
# Generate some files
@@ -1120,8 +1125,8 @@ CLEAN_FILES += vmlinux System.map \
.tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map
# Directories & files removed with 'make mrproper'
-MRPROPER_DIRS += include/config include2 usr/include
-MRPROPER_FILES += .config .config.old include/asm .version .old_version \
+MRPROPER_DIRS += include/config include2 usr/include include/asm
+MRPROPER_FILES += .config .config.old .version .old_version \
include/linux/autoconf.h include/linux/version.h \
include/linux/utsrelease.h \
include/linux/bounds.h include/asm*/asm-offsets.h \
--
1.5.4.1.143.ge7e51
next prev parent reply other threads:[~2008-06-21 22:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-21 22:07 Support arch/$ARCH/include in kbuild Sam Ravnborg
2008-06-21 22:08 ` [PATCH] kbuild: prepare headers_* for arch/$ARCH/include Sam Ravnborg
2008-06-21 22:08 ` Sam Ravnborg [this message]
2008-06-21 22:11 ` Support arch/$ARCH/include in kbuild Sam Ravnborg
2008-06-22 22:05 ` Sam Ravnborg
2008-06-22 22:08 ` [PATCH 1/5] kbuild: prepare headers_* for arch/$ARCH/include Sam Ravnborg
2008-06-24 14:31 ` Arnd Bergmann
2008-06-22 22:08 ` [PATCH 2/5] kbuild: include/asm may be a file - fix mrproper for this Sam Ravnborg
2008-06-22 22:08 ` [PATCH 3/5] kbuild: support arch/$ARCH/include for tags, cscope Sam Ravnborg
2008-06-22 22:08 ` [PATCH 4/5] kbuild: asm symlink support for arch/$ARCH/include Sam Ravnborg
2008-06-22 22:08 ` [PATCH 5/5] kbuild: add arch/$ARCH/include to search path Sam Ravnborg
2008-06-24 15:32 ` Support arch/$ARCH/include in kbuild Arnd Bergmann
2008-06-26 18:56 ` Sam Ravnborg
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=20080621220851.GC12279@uranus.ravnborg.org \
--to=sam@ravnborg.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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