Commit 8556b961 authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: clean up arch/i386/boot, part 4

Use the provided rule for linking files and final polish.
Apart from being internally more logically structured, 
"make KBUILD_VERBOSE= bzImage" output looks much improved now as
well.
parent a94674e2
......@@ -25,8 +25,8 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
#RAMDISK := -DRAMDISK=512
EXTRA_TARGETS := vmlinux.bin bvmlinux.bin bootsect.o bbootsect.o \
setup.o bsetup.o
EXTRA_TARGETS := vmlinux.bin bvmlinux.bin bootsect bootsect.o \
setup setup.o zImage bzImage
host-progs := tools/build
......@@ -40,15 +40,26 @@ bzImage: IMAGE_OFFSET := 0x100000
bzImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
bzImage: BUILDFLAGS := -b
zImage bzImage: bootsect setup vmlinux.bin tools/build
tools/build $(BUILDFLAGS) bootsect setup vmlinux.bin $(ROOT_DEV) > $@
quiet_cmd_image = BUILD $(RELDIR)/$@
cmd_image = tools/build $(BUILDFLAGS) bootsect setup vmlinux.bin \
$(ROOT_DEV) > $@
zImage bzImage: bootsect setup vmlinux.bin tools/build FORCE
$(call if_changed,image)
vmlinux.bin: compressed/vmlinux FORCE
$(call if_changed,objcopy)
LDFLAGS_bootsect := -Ttext 0x0 -s --oformat binary
LDFLAGS_setup := -Ttext 0x0 -s --oformat binary -e begtext
setup bootsect: %: %.o FORCE
$(call if_changed,ld)
compressed/vmlinux: FORCE
@$(MAKE) IMAGE_OFFSET=$(IMAGE_OFFSET) -C compressed vmlinux
zdisk: $(BOOTIMAGE)
dd bs=8192 if=$(BOOTIMAGE) of=/dev/fd0
......@@ -62,12 +73,6 @@ zlilo: $(BOOTIMAGE)
install: $(BOOTIMAGE)
sh -x ./install.sh $(KERNELRELEASE) $(BOOTIMAGE) $(TOPDIR)/System.map "$(INSTALL_PATH)"
bootsect: bootsect.o
$(LD) $(LDFLAGS) -Ttext 0x0 -s --oformat binary -o $@ $<
setup: setup.o
$(LD) $(LDFLAGS) -Ttext 0x0 -s --oformat binary -e begtext -o $@ $<
clean:
@echo 'Cleaning up (boot)'
@rm -f tools/build
......
......@@ -4,22 +4,15 @@
# create a compressed vmlinux image from the original vmlinux
#
HEAD = head.o
OBJECTS = $(HEAD) misc.o
#
# ZIMAGE_OFFSET is the load offset of the compression loader
# BZIMAGE_OFFSET is the load offset of the high loaded compression loader
#
EXTRA_TARGETS := vmlinux.bin vmlinux.bin.gz head.o misc.o
LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup_32
EXTRA_TARGETS := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
EXTRA_AFLAGS := -traditional
include $(TOPDIR)/Rules.make
vmlinux: piggy.o $(OBJECTS)
$(LD) $(LDFLAGS) $(LDFLAGS_$@) -o vmlinux $(OBJECTS) piggy.o
LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup_32
vmlinux: head.o misc.o piggy.o FORCE
$(call if_changed,ld)
vmlinux.bin: $(TOPDIR)/vmlinux FORCE
$(call if_changed,objcopy)
......@@ -27,8 +20,10 @@ vmlinux.bin: $(TOPDIR)/vmlinux FORCE
vmlinux.bin.gz: vmlinux.bin FORCE
$(call if_changed,gzip)
piggy.o: vmlinux.bin.gz vmlinux.scr
$(LD) $(LDFLAGS) -r -o piggy.o -b binary $< -b elf32-i386 -T vmlinux.scr
LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
piggy.o: vmlinux.scr vmlinux.bin.gz FORCE
$(call if_changed,ld)
clean:
@rm -f vmlinux bvmlinux vmlinux.bin vmlinux.bin.gz
@rm -f vmlinux vmlinux.bin vmlinux.bin.gz
SECTIONS
{
.data : {
input_len = .;
LONG(input_data_end - input_data) input_data = .;
*(.data)
input_data_end = .;
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment