From: Sam Ravnborg <sam@ravnborg.org>
To: Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-kbuild <linux-kbuild@vger.kernel.org>
Cc: Jay Cliburn <jacliburn@bellsouth.net>,
Jan Altenberg <jan.altenberg@linutronix.de>
Subject: [GIT PATCHES] 2x kbuild fixes for -rc
Date: Sun, 9 Dec 2007 09:05:32 +0100 [thread overview]
Message-ID: <20071209080532.GA4954@uranus.ravnborg.org> (raw)
Hi Linus.
Following are two fixes for two kbuild regressions that
has not been tracked by Rafael's list but anyway has
been sitting in my mailbox.
Please pull from:
ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/fix-kbuild.git
to receive the following patches:
Sam Ravnborg (2):
kbuild: fix building with redirected output.
kbuild: fix building with O=.. options
Makefile | 14 ++++++--------
scripts/mkmakefile | 6 ++++++
2 files changed, 12 insertions(+), 8 deletions(-)
Full diff of both patches:
diff --git a/Makefile b/Makefile
index 92dc3cb..7fb1a2c 100644
--- a/Makefile
+++ b/Makefile
@@ -108,6 +108,9 @@ endif
PHONY := _all
_all:
+# Cancel implicit rules on top Makefile
+$(CURDIR)/Makefile Makefile: ;
+
ifneq ($(KBUILD_OUTPUT),)
# Invoke a second make in the output directory, passing relevant variables
# check that the output directory actually exists
@@ -115,13 +118,10 @@ saved-output := $(KBUILD_OUTPUT)
KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
$(if $(KBUILD_OUTPUT),, \
$(error output directory "$(saved-output)" does not exist))
-# Check that OUTPUT directory is not the same as where we have kernel src
-$(if $(filter-out $(KBUILD_OUTPUT),$(shell /bin/pwd)),, \
- $(error Output directory (O=...) specifies kernel src dir))
PHONY += $(MAKECMDGOALS) sub-make
-$(filter-out _all sub-make,$(MAKECMDGOALS)) _all: sub-make
+$(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
$(Q)@:
sub-make: FORCE
@@ -291,7 +291,8 @@ export quiet Q KBUILD_VERBOSE
# Look for make include files relative to root of kernel src
MAKEFLAGS += --include-dir=$(srctree)
-# We need some generic definitions.
+# We need some generic definitions (do not try to remake the file).
+$(srctree)/scripts/Kbuild.include: ;
include $(srctree)/scripts/Kbuild.include
# Make variables (CC, etc...)
@@ -1560,9 +1561,6 @@ endif # skip-makefile
PHONY += FORCE
FORCE:
-# Cancel implicit rules on top Makefile, `-rR' will apply to sub-makes.
-Makefile: ;
-
# Declare the contents of the .PHONY variable as phony. We keep that
# information in a variable se we can use it in if_changed and friends.
.PHONY: $(PHONY)
diff --git a/scripts/mkmakefile b/scripts/mkmakefile
index ee39fac..9ad1bd7 100644
--- a/scripts/mkmakefile
+++ b/scripts/mkmakefile
@@ -11,6 +11,12 @@
test ! -r $2/Makefile -o -O $2/Makefile || exit 0
+# Only overwrite automatically generated Makefiles
+# (so we do not overwrite kernel Makefile)
+if ! grep -q Automatically $2/Makefile
+then
+ exit 0
+fi
echo " GEN $2/Makefile"
cat << EOF > $2/Makefile
reply other threads:[~2007-12-09 8:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20071209080532.GA4954@uranus.ravnborg.org \
--to=sam@ravnborg.org \
--cc=akpm@linux-foundation.org \
--cc=jacliburn@bellsouth.net \
--cc=jan.altenberg@linutronix.de \
--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
Powered by JetHome