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 ...@@ -25,8 +25,8 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
#RAMDISK := -DRAMDISK=512 #RAMDISK := -DRAMDISK=512
EXTRA_TARGETS := vmlinux.bin bvmlinux.bin bootsect.o bbootsect.o \ EXTRA_TARGETS := vmlinux.bin bvmlinux.bin bootsect bootsect.o \
setup.o bsetup.o setup setup.o zImage bzImage
host-progs := tools/build host-progs := tools/build
...@@ -40,15 +40,26 @@ bzImage: IMAGE_OFFSET := 0x100000 ...@@ -40,15 +40,26 @@ bzImage: IMAGE_OFFSET := 0x100000
bzImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__ bzImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
bzImage: BUILDFLAGS := -b bzImage: BUILDFLAGS := -b
zImage bzImage: bootsect setup vmlinux.bin tools/build quiet_cmd_image = BUILD $(RELDIR)/$@
tools/build $(BUILDFLAGS) bootsect setup vmlinux.bin $(ROOT_DEV) > $@ 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 vmlinux.bin: compressed/vmlinux FORCE
$(call if_changed,objcopy) $(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 compressed/vmlinux: FORCE
@$(MAKE) IMAGE_OFFSET=$(IMAGE_OFFSET) -C compressed vmlinux @$(MAKE) IMAGE_OFFSET=$(IMAGE_OFFSET) -C compressed vmlinux
zdisk: $(BOOTIMAGE) zdisk: $(BOOTIMAGE)
dd bs=8192 if=$(BOOTIMAGE) of=/dev/fd0 dd bs=8192 if=$(BOOTIMAGE) of=/dev/fd0
...@@ -62,12 +73,6 @@ zlilo: $(BOOTIMAGE) ...@@ -62,12 +73,6 @@ zlilo: $(BOOTIMAGE)
install: $(BOOTIMAGE) install: $(BOOTIMAGE)
sh -x ./install.sh $(KERNELRELEASE) $(BOOTIMAGE) $(TOPDIR)/System.map "$(INSTALL_PATH)" 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: clean:
@echo 'Cleaning up (boot)' @echo 'Cleaning up (boot)'
@rm -f tools/build @rm -f tools/build
......
...@@ -4,22 +4,15 @@ ...@@ -4,22 +4,15 @@
# create a compressed vmlinux image from the original vmlinux # create a compressed vmlinux image from the original vmlinux
# #
HEAD = head.o EXTRA_TARGETS := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.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_AFLAGS := -traditional EXTRA_AFLAGS := -traditional
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
vmlinux: piggy.o $(OBJECTS) LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup_32
$(LD) $(LDFLAGS) $(LDFLAGS_$@) -o vmlinux $(OBJECTS) piggy.o
vmlinux: head.o misc.o piggy.o FORCE
$(call if_changed,ld)
vmlinux.bin: $(TOPDIR)/vmlinux FORCE vmlinux.bin: $(TOPDIR)/vmlinux FORCE
$(call if_changed,objcopy) $(call if_changed,objcopy)
...@@ -27,8 +20,10 @@ vmlinux.bin: $(TOPDIR)/vmlinux FORCE ...@@ -27,8 +20,10 @@ vmlinux.bin: $(TOPDIR)/vmlinux FORCE
vmlinux.bin.gz: vmlinux.bin FORCE vmlinux.bin.gz: vmlinux.bin FORCE
$(call if_changed,gzip) $(call if_changed,gzip)
piggy.o: vmlinux.bin.gz vmlinux.scr LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
$(LD) $(LDFLAGS) -r -o piggy.o -b binary $< -b elf32-i386 -T vmlinux.scr
piggy.o: vmlinux.scr vmlinux.bin.gz FORCE
$(call if_changed,ld)
clean: 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