Commit abcdaf4b authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Don't descend into arch/i386/boot

We don't descend anymore when building vmlinux, so don't do so for
the i386 specific boot targets, either.

Plus, more cleanup in arch/i386/Makefile
parent 56a8f5d4
...@@ -457,7 +457,7 @@ cmd_shipped = cat $< > $@ ...@@ -457,7 +457,7 @@ cmd_shipped = cat $< > $@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
quiet_cmd_ld = LD $(echo_target) quiet_cmd_ld = LD $(echo_target)
cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$@) \ cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \
$(filter-out FORCE,$^) -o $@ $(filter-out FORCE,$^) -o $@
# Objcopy # Objcopy
......
...@@ -25,65 +25,23 @@ CFLAGS += -pipe ...@@ -25,65 +25,23 @@ CFLAGS += -pipe
# prevent gcc from keeping the stack 16 byte aligned # prevent gcc from keeping the stack 16 byte aligned
CFLAGS += $(shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; fi) CFLAGS += $(shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; fi)
ifdef CONFIG_M386 cflags-$(CONFIG_M386) += -march=i386
CFLAGS += -march=i386 cflags-$(CONFIG_M486) += -march=i486
endif cflags-$(CONFIG_M586) += -march=i586
cflags-$(CONFIG_M586TSC) += -march=i586
ifdef CONFIG_M486 cflags-$(CONFIG_M586MMX) += -march=i586
CFLAGS += -march=i486 cflags-$(CONFIG_M686) += -march=i686
endif cflags-$(CONFIG_MPENTIUMIII) += -march=i686
cflags-$(CONFIG_MPENTIUM4) += -march=i686
ifdef CONFIG_M586 cflags-$(CONFIG_MK6) += $(shell if $(CC) -march=k6 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=k6"; else echo "-march=i586"; fi)
CFLAGS += -march=i586 cflags-$(CONFIG_MK7) += $(shell if $(CC) -march=athlon -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon"; else echo "-march=i686 -malign-functions=4"; fi)
endif cflags-$(CONFIG_MCRUSOE) += -march=i686 -malign-functions=0 -malign-jumps=0 -malign-loops=0
cflags-$(CONFIG_MWINCHIPC6) += -march=i586
ifdef CONFIG_M586TSC cflags-$(CONFIG_MWINCHIP2) += -march=i586
CFLAGS += -march=i586 cflags-$(CONFIG_MWINCHIP3D) += -march=i586
endif cflags-$(CONFIG_MCYRIXIII) += -march=i586
ifdef CONFIG_M586MMX CFLAGS += $(cflags-y)
CFLAGS += -march=i586
endif
ifdef CONFIG_M686
CFLAGS += -march=i686
endif
ifdef CONFIG_MPENTIUMIII
CFLAGS += -march=i686
endif
ifdef CONFIG_MPENTIUM4
CFLAGS += -march=i686
endif
ifdef CONFIG_MK6
CFLAGS += $(shell if $(CC) -march=k6 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=k6"; else echo "-march=i586"; fi)
endif
ifdef CONFIG_MK7
CFLAGS += $(shell if $(CC) -march=athlon -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon"; else echo "-march=i686 -malign-functions=4"; fi)
endif
ifdef CONFIG_MCRUSOE
CFLAGS += -march=i686 -malign-functions=0 -malign-jumps=0 -malign-loops=0
endif
ifdef CONFIG_MWINCHIPC6
CFLAGS += -march=i586
endif
ifdef CONFIG_MWINCHIP2
CFLAGS += -march=i586
endif
ifdef CONFIG_MWINCHIP3D
CFLAGS += -march=i586
endif
ifdef CONFIG_MCYRIXIII
CFLAGS += -march=i586
endif
ifdef CONFIG_VISWS ifdef CONFIG_VISWS
MACHINE := mach-visws MACHINE := mach-visws
...@@ -94,47 +52,39 @@ endif ...@@ -94,47 +52,39 @@ endif
HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o
libs-y += arch/i386/lib/ libs-y += arch/i386/lib/
core-y += arch/i386/kernel/ arch/i386/mm/ arch/i386/$(MACHINE)/ core-y += arch/i386/kernel/ arch/i386/mm/ \
arch/i386/$(MACHINE)/
drivers-$(CONFIG_MATH_EMULATION) += arch/i386/math-emu/ drivers-$(CONFIG_MATH_EMULATION) += arch/i386/math-emu/
drivers-$(CONFIG_PCI) += arch/i386/pci/ drivers-$(CONFIG_PCI) += arch/i386/pci/
CFLAGS += -Iarch/i386/$(MACHINE) CFLAGS += -Iarch/i386/$(MACHINE)
AFLAGS += -Iarch/i386/$(MACHINE) AFLAGS += -Iarch/i386/$(MACHINE)
MAKEBOOT = +$(MAKE) -C arch/$(ARCH)/boot makeboot = $(call descend,arch/i386/boot,$(1))
.PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \ .PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \
clean archclean archmrproper clean archclean archmrproper
all: bzImage all: bzImage
zImage: vmlinux BOOTIMAGE=arch/i386/boot/bzImage
@$(MAKEBOOT) zImage zImage zlilo zdisk: BOOTIMAGE=arch/i386/boot/zImage
bzImage: vmlinux zImage bzImage: vmlinux
@$(MAKEBOOT) bzImage @$(call makeboot,$(BOOTIMAGE))
compressed: zImage compressed: zImage
zlilo: vmlinux zlilo bzlilo: vmlinux
@$(MAKEBOOT) BOOTIMAGE=zImage zlilo @$(call makeboot,BOOTIMAGE=$(BOOTIMAGE) zlilo)
tmp:
@$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
bzlilo: vmlinux
@$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
zdisk: vmlinux
@$(MAKEBOOT) BOOTIMAGE=zImage zdisk
bzdisk: vmlinux zdisk bzdisk: vmlinux
@$(MAKEBOOT) BOOTIMAGE=bzImage zdisk @$(call makeboot,BOOTIMAGE=$(BOOTIMAGE) zdisk)
install: vmlinux install: vmlinux
@echo 'Cleaning up (arch)' @$(call makeboot,BOOTIMAGE=$(BOOTIMAGE) install)
@$(MAKEBOOT) BOOTIMAGE=bzImage install
archclean: archclean:
@$(MAKEBOOT) clean @$(call makeboot,clean)
archmrproper: archmrproper:
...@@ -38,30 +38,32 @@ include $(TOPDIR)/Rules.make ...@@ -38,30 +38,32 @@ include $(TOPDIR)/Rules.make
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
zImage: IMAGE_OFFSET := 0x1000 $(obj)/zImage: IMAGE_OFFSET := 0x1000
zImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) $(obj)/zImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK)
bzImage: IMAGE_OFFSET := 0x100000 $(obj)/bzImage: IMAGE_OFFSET := 0x100000
bzImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__ $(obj)/bzImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
bzImage: BUILDFLAGS := -b $(obj)/bzImage: BUILDFLAGS := -b
quiet_cmd_image = BUILD $(echo_target) quiet_cmd_image = BUILD $(echo_target)
cmd_image = tools/build $(BUILDFLAGS) bootsect setup vmlinux.bin \ cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/bootsect $(obj)/setup \
$(ROOT_DEV) > $@ $(obj)/vmlinux.bin $(ROOT_DEV) > $@
zImage bzImage: bootsect setup vmlinux.bin tools/build FORCE $(obj)/zImage $(obj)/bzImage: $(obj)/bootsect $(obj)/setup \
$(obj)/vmlinux.bin $(obj)/tools/build FORCE
$(call if_changed,image) $(call if_changed,image)
vmlinux.bin: compressed/vmlinux FORCE $(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE
$(call if_changed,objcopy) $(call if_changed,objcopy)
LDFLAGS_bootsect := -Ttext 0x0 -s --oformat binary LDFLAGS_bootsect := -Ttext 0x0 -s --oformat binary
LDFLAGS_setup := -Ttext 0x0 -s --oformat binary -e begtext LDFLAGS_setup := -Ttext 0x0 -s --oformat binary -e begtext
setup bootsect: %: %.o FORCE $(obj)/setup $(obj)/bootsect: %: %.o FORCE
$(call if_changed,ld) $(call if_changed,ld)
compressed/vmlinux: FORCE $(obj)/compressed/vmlinux: FORCE
@$(MAKE) IMAGE_OFFSET=$(IMAGE_OFFSET) -C compressed vmlinux @$(call descend,$(obj)/compressed,IMAGE_OFFSET=$(IMAGE_OFFSET) \
$(obj)/compressed/vmlinux)
zdisk: $(BOOTIMAGE) zdisk: $(BOOTIMAGE)
...@@ -71,18 +73,17 @@ zlilo: $(BOOTIMAGE) ...@@ -71,18 +73,17 @@ zlilo: $(BOOTIMAGE)
if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
cat $(BOOTIMAGE) > $(INSTALL_PATH)/vmlinuz cat $(BOOTIMAGE) > $(INSTALL_PATH)/vmlinuz
cp $(TOPDIR)/System.map $(INSTALL_PATH)/ cp System.map $(INSTALL_PATH)/
if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
install: $(BOOTIMAGE) install: $(BOOTIMAGE)
sh -x ./install.sh $(KERNELRELEASE) $(BOOTIMAGE) $(TOPDIR)/System.map "$(INSTALL_PATH)" sh $(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
clean: clean:
@echo 'Cleaning up (boot)' @echo 'Cleaning up (boot)'
@rm -f tools/build vmlinux.bin bvmlinux.bin @rm -f $(addprefix $(obj)/,tools/build vmlinux.bin bvmlinux.bin \
@rm -f setup bootsect zImage compressed/vmlinux.out bootsect zImage bsetup bbootsect bzImage)
@rm -f bsetup bbootsect bzImage compressed/bvmlinux.out @$(call descend,$(obj)/compressed) clean
@$(MAKE) -C compressed clean
archhelp: archhelp:
@echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)' @echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)'
......
...@@ -11,19 +11,20 @@ include $(TOPDIR)/Rules.make ...@@ -11,19 +11,20 @@ include $(TOPDIR)/Rules.make
LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup_32 LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup_32
vmlinux: head.o misc.o piggy.o FORCE $(obj)/vmlinux: $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o FORCE
$(call if_changed,ld) $(call if_changed,ld)
vmlinux.bin: $(TOPDIR)/vmlinux FORCE $(obj)/vmlinux.bin: vmlinux FORCE
$(call if_changed,objcopy) $(call if_changed,objcopy)
vmlinux.bin.gz: vmlinux.bin FORCE $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
$(call if_changed,gzip) $(call if_changed,gzip)
LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
piggy.o: vmlinux.scr vmlinux.bin.gz FORCE $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
$(call if_changed,ld) $(call if_changed,ld)
clean: clean:
@rm -f vmlinux vmlinux.bin vmlinux.bin.gz @echo 'Cleaning up (boot/compressed)'
@rm -f $(addprefix $(obj)/,vmlinux vmlinux.bin vmlinux.bin.gz)
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