All of lore.kernel.org
 help / color / mirror / Atom feed
* kbuild Makefile: allow checking if ARCH and CROSS_COMPILE is set
@ 2005-03-03 15:46 David Vrabel
  0 siblings, 0 replies; only message in thread
From: David Vrabel @ 2005-03-03 15:46 UTC (permalink / raw)
  To: kai, sam; +Cc: Linux Kernel

Hi,

It can be useful for distributors for kernel source trees intended
for cross-compilation only (e.g., for embedded targets) to ensure
the user has set ARCH and CROSS_COMPILE.

This patch allows one to create the file .force-cross-compile containing
the word "yes" to enable such a test.

Signed-off-by: David Vrabel <dvrabel@arcom.com>

Index: linux-2.6-working/Makefile
===================================================================
--- linux-2.6-working.orig/Makefile	2005-03-03 15:03:33.177767998 +0000
+++ linux-2.6-working/Makefile	2005-03-03 15:21:44.366657764 +0000
@@ -189,6 +189,19 @@
 # Default value for CROSS_COMPILE is not to prefix executables
 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile

+# Creating the file .force-cross-compile containing the word "yes"
+# will ensure the user specifies ARCH and CROSS_COMPILE.  This is
+# handy for distributers of kernel trees intended for
+# cross-compilation only.
+ifeq ($(shell cat .force-cross-compile),yes)
+  ifeq ($(ARCH),)
+    $(error ARCH is unset)
+  endif
+  ifeq ($(CROSS_COMPILE),)
+    $(error CROSS_COMPILE is unset)
+  endif
+endif
+
 ARCH		?= $(SUBARCH)
 CROSS_COMPILE	?=


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-03 15:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-03 15:46 kbuild Makefile: allow checking if ARCH and CROSS_COMPILE is set David Vrabel

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.