]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/boot/Makefile
x86: when building image.iso, use isohybrid if it exists
[linux-2.6-omap-h63xx.git] / arch / x86 / boot / Makefile
index 349b81a39c40b586275a5c8695f058ac80bc162f..cceba1f46365aa30615314144fe9356decb596af 100644 (file)
@@ -26,11 +26,11 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
 #RAMDISK := -DRAMDISK=512
 
 targets                := vmlinux.bin setup.bin setup.elf zImage bzImage
-subdir-        := compressed
+subdir-                := compressed
 
 setup-y                += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o
 setup-y                += header.o main.o mca.o memory.o pm.o pmjump.o
-setup-y                += printf.o string.o tty.o video.o version.o
+setup-y                += printf.o string.o tty.o video.o video-mode.o version.o
 setup-$(CONFIG_X86_APM_BOOT) += apm.o
 setup-$(CONFIG_X86_VOYAGER) += voyager.o
 
@@ -43,9 +43,17 @@ setup-y              += video-vesa.o
 setup-y                += video-bios.o
 
 targets                += $(setup-y)
-hostprogs-y    := tools/build
+hostprogs-y    := mkcpustr tools/build
 
-HOSTCFLAGS_build.o := $(LINUXINCLUDE)
+HOST_EXTRACFLAGS += $(LINUXINCLUDE)
+
+$(obj)/cpu.o: $(obj)/cpustr.h
+
+quiet_cmd_cpustr = CPUSTR  $@
+      cmd_cpustr = $(obj)/mkcpustr > $@
+targets                += cpustr.h
+$(obj)/cpustr.h: $(obj)/mkcpustr FORCE
+       $(call if_changed,cpustr)
 
 # ---------------------------------------------------------------------------
 
@@ -80,17 +88,31 @@ $(obj)/zImage $(obj)/bzImage: $(obj)/setup.bin \
        $(call if_changed,image)
        @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
 
+OBJCOPYFLAGS_vmlinux.bin := -O binary -R .note -R .comment -S
 $(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE
        $(call if_changed,objcopy)
 
 SETUP_OBJS = $(addprefix $(obj)/,$(setup-y))
 
+sed-offsets := -e 's/^00*/0/' \
+        -e 's/^\([0-9a-fA-F]*\) . \(input_data\|input_data_end\)$$/\#define \2 0x\1/p'
+
+quiet_cmd_offsets = OFFSETS $@
+      cmd_offsets = $(NM) $< | sed -n $(sed-offsets) > $@
+
+$(obj)/offsets.h: $(obj)/compressed/vmlinux FORCE
+       $(call if_changed,offsets)
+
+targets += offsets.h
+
+AFLAGS_header.o += -I$(obj)
+$(obj)/header.o: $(obj)/offsets.h
+
 LDFLAGS_setup.elf      := -T
 $(obj)/setup.elf: $(src)/setup.ld $(SETUP_OBJS) FORCE
        $(call if_changed,ld)
 
 OBJCOPYFLAGS_setup.bin := -O binary
-
 $(obj)/setup.bin: $(obj)/setup.elf FORCE
        $(call if_changed,objcopy)
 
@@ -98,7 +120,7 @@ $(obj)/compressed/vmlinux: FORCE
        $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@
 
 # Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel
-FDARGS = 
+FDARGS =
 # Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel
 FDINITRD =
 
@@ -159,6 +181,7 @@ isoimage: $(BOOTIMAGE)
        mkisofs -J -r -o $(obj)/image.iso -b isolinux.bin -c boot.cat \
                -no-emul-boot -boot-load-size 4 -boot-info-table \
                $(obj)/isoimage
+       isohybrid $(obj)/image.iso 2>/dev/null || true
        rm -rf $(obj)/isoimage
 
 zlilo: $(BOOTIMAGE)