LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [RFC] kbuild: Specify default target during configuration
@ 2004-05-30 19:38 Sam Ravnborg
0 siblings, 0 replies; only message in thread
From: Sam Ravnborg @ 2004-05-30 19:38 UTC (permalink / raw)
To: linux-kernel; +Cc: Andrew Morton, Linus Torvalds
Following patchs allows one to specify default target when
doing make *config.
This has the advantage that kbuild knows the final target, a knowledge
that is required when building rpm's or deb's.
The following patch introduce selecting default target for i386,
and is mainly a RFC. If there is no big complains I will update it
to cover a few more architectures before submitting.
Comments to the suggested help texts is also appreciated.
Sam
===== arch/i386/Kconfig 1.121 vs edited =====
--- 1.121/arch/i386/Kconfig 2004-05-10 13:25:50 +02:00
+++ edited/arch/i386/Kconfig 2004-05-30 21:25:41 +02:00
@@ -29,6 +29,42 @@
bool
default y
+choice
+ prompt "Default kernel image"
+ default KERNEL_IMAGE_BZIMAGE
+ help
+ Specify which kernel image to be build when executing 'make' with
+ no arguments.
+
+config KERNEL_IMAGE_BZIMAGE
+ bool "bzImage - Compressed kernel image"
+ help
+ bzImage - located at arch/i386/boot/bzImage.
+ bzImage can accept larger kernels than zImage
+
+config KERNEL_IMAGE_ZIMAGE
+ bool "zImage - Compressed kernel image"
+ help
+ zImage - located at arch/i386/boot/zImage.
+ zImage is seldom used. zImage supports smaller kernels than bzImage,
+ and is only used in special situations.
+
+config KERNEL_IMAGE_VMLINUX
+ bool "vmlinux - the bare kernel"
+ help
+ vmlinux - located at the root of the kernel tree
+ vmlinux contains the kernel image with no additional bootloader.
+ vmlinux is seldom used as target for i386.
+
+endchoice
+
+config KERNEL_IMAGE
+ string
+ default arch/i386/boot/bzImage if KERNEL_IMAGE_BZIMAGE
+ default arch/i386/boot/zImage if KERNEL_IMAGE_ZIMAGE
+ default vmlinux if KERNEL_IMAGE_VMLINUX
+
+
source "init/Kconfig"
===== Makefile 1.492 vs edited =====
--- 1.492/Makefile 2004-05-30 08:24:06 +02:00
+++ edited/Makefile 2004-05-30 21:35:32 +02:00
@@ -409,13 +409,6 @@
scripts_basic: include/linux/autoconf.h
-
-# That's our default target when none is given on the command line
-# Note that 'modules' will be added as a prerequisite as well,
-# in the CONFIG_MODULES part below
-
-all: vmlinux
-
# Objects we will link into vmlinux / subdirs we need to visit
init-y := init/
drivers-y := drivers/ sound/
@@ -448,6 +441,11 @@
endif
include $(srctree)/arch/$(ARCH)/Makefile
+
+# Let all: depend on target selected in .config
+# Hereby user only have to issue 'make' to build the kernel, including
+# selected kernel
+all: $(subst ",,$(CONFIG_KERNEL_IMAGE))
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
CFLAGS += -Os
===== arch/i386/Makefile 1.67 vs edited =====
--- 1.67/arch/i386/Makefile 2004-05-15 08:11:50 +02:00
+++ edited/arch/i386/Makefile 2004-05-30 21:27:17 +02:00
@@ -115,18 +115,20 @@
boot := arch/i386/boot
-.PHONY: zImage bzImage compressed zlilo bzlilo \
- zdisk bzdisk fdimage fdimage144 fdimage288 install
+# Lot's of documentation refer to these, so keep the short versions for now
+.PHONY: bzImage zImage compressed
+bzImage: $(boot)/bzImage
+zImage: $(boot)/zImage
+compressed: $(boot)/zImage
-all: bzImage
+# Target's that install the kernel
+.PHONY: zlilo bzlilo zdisk bzdisk fdimage fdimage144 fdimage288 install
BOOTIMAGE=arch/i386/boot/bzImage
-zImage zlilo zdisk: BOOTIMAGE=arch/i386/boot/zImage
+zlilo zdisk: BOOTIMAGE=arch/i386/boot/zImage
-zImage bzImage: vmlinux
- $(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE)
-
-compressed: zImage
+$(boot)/zImage $(boot)/bzImage: vmlinux
+ $(Q)$(MAKE) $(build)=$(boot) $@
zlilo bzlilo: vmlinux
$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zlilo
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-05-30 19:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-30 19:38 [RFC] kbuild: Specify default target during configuration Sam Ravnborg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).