[PATCH] Saving ARCH and CROSS_COMPILE in generated Makefile

From: Pavel Roskin
Date: Wed May 04 2005 - 18:12:54 EST


Hello!

I don't want to specify ARCH and CROSS_COMPILE with every make
invocation when cross-compiling the kernel. I believe they should be
saved somewhere. The most natural place would be .config, but I guess
it's not acceptable for some reason, or it would have been done long
ago.

The second best place would be the Makefile generated in the build
directory when the kernel is compiled outside the source tree. The
patch below implements that.

Unfortunately, builds in the source directory would not profit from this
patch. Perhaps we could always generate "makefile" or "GNUmakefile" in
the build directory, but it would be another patch. Anyway, few people
cross-compile their kernels, and it's not unreasonable to encourage them
to use out-of-tree builds.

SUBARCH is not saved on purpose, since users are not supposed to
override it.

Compiling external modules against the build tree does the right thing
without ARCH and CROSS_COMPILE being specified.

Signed-off-by: Pavel Roskin <proski@xxxxxxx>

Index: scripts/mkmakefile
===================================================================
--- 2aa9e4732d7014dcda4c0e80d2e377f52e2262e9/scripts/mkmakefile (mode:100644 sha1:c4d621b30d0db1649d99f9cebf31377cc2d8d32b)
+++ uncommitted/scripts/mkmakefile (mode:100644)
@@ -21,6 +21,11 @@

MAKEFLAGS += --no-print-directory

+ARCH = $ARCH
+CROSS_COMPILE = $CROSS_COMPILE
+
+export ARCH CROSS_COMPILE
+
all:
\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT)



--
Regards,
Pavel Roskin

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/