patch-2.1.44 linux/arch/mips/boot/Makefile

Next file: linux/arch/mips/boot/mkboot.c
Previous file: linux/arch/mips/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.43/linux/arch/mips/boot/Makefile linux/arch/mips/boot/Makefile
@@ -19,47 +19,32 @@
 # Drop some uninteresting sections in the kernel.
 # This is only relevant for ELF kernels but doesn't hurt a.out
 #
-DROP_SECTIONS	= .reginfo .mdebug
-
-#
-# The new options of binutils 2.6 help to shrink object files a lot.
-# This is especially useful for booting from floppy.  Though we
-# don't yet require everyone to have binutils 2.6 installed.
-#
-OBJDUMP_VERSION =  $(word 4,$(shell $(OBJDUMP) --version))
-ifneq ($(OBJDUMP_VERSION),2.5.2)
-KEEP = kernel_entry boot_info screen_info _end
-STRIP_FLAGS = $(addprefix --keep-symbol=,$(KEEP))
-else
-STRIP_FLAGS = --discard-all
-endif
+drop-sections	= .reginfo .mdebug
+strip-flags	= $(addprefix --remove-section=,$(drop-sections))
 
 #
 # Fake compressed boot
 #
-ifdef CONFIG_ELF_KERNEL
-zImage:	$(CONFIGURE) $(TOPDIR)/vmlinux
-	cp $(TOPDIR)/vmlinux zImage.tmp
-	$(STRIP) $(addprefix --remove-section=,$(DROP_SECTIONS)) \
-		--strip-symbol=blurb zImage.tmp
-	$(LD) -oformat=$(oformat) -N -e except_vec0 -Ttext=0x80000000 \
-		-o zImage zImage.tmp
+zImage:	$(CONFIGURE) mkboot $(TOPDIR)/vmlinux
+	$(OBJCOPY) $(strip-flags) $(TOPDIR)/vmlinux zImage.tmp
+	./mkboot zImage.tmp zImage
 	rm -f zImage.tmp
-	$(STRIP) $(STRIP_FLAGS) zImage
-else
-zImage:	$(CONFIGURE) $(TOPDIR)/vmlinux
-	cp $(TOPDIR)/vmlinux $@
-	$(STRIP) $(STRIP_FLAGS) $@
-endif
+
+mkboot: mkboot.c
+	$(HOSTCC) -o $@ $^
 
 zdisk:	zImage
-	mcopy -n zImage a:vmlinux
+	if [ -f /etc/remote-mcopy ]; then \
+		ssh rio mcopy -o - a:vmlinux <zImage; \
+	else \
+		mcopy -o zImage a:vmlinux; \
+	fi
 
 dep:
 	$(CPP) -M *.[cS] > .depend
 
 clean:
-	rm -f zImage zImage.tmp
+	rm -f zImage zImage.tmp mkboot
 
 dummy:
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov